Not installing on macOS


#1

Not completing installation. Can’t figure out what is going on.
(macOS 10.12.6, Node 8.9.1)

Tried:
$ sudo npm install -g nativescript

Result:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: abbrev@1.1.0 (node_modules/nativescript/node_modules/fsevents/node_modules/abbrev):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename ‘/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/abbrev’ -> '/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/.abbrev.DELETE’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: aproba@1.1.1 (node_modules/nativescript/node_modules/fsevents/node_modules/aproba):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename ‘/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/aproba’ -> '/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/.aproba.DELETE’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: asn1@0.2.3 (node_modules/nativescript/node_modules/fsevents/node_modules/asn1):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename ‘/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/asn1’ -> '/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/.asn1.DELETE’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: assert-plus@0.2.0 (node_modules/nativescript/node_modules/fsevents/node_modules/assert-plus):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename ‘/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/assert-plus’ -> '/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/.assert-plus.DELETE’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: asynckit@0.4.0 (node_modules/nativescript/node_modules/fsevents/node_modules/asynckit):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename ‘/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/asynckit’ -> '/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/.asynckit.DELETE’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: aws-sign2@0.6.0 (node_modules/nativescript/node_modules/fsevents/node_modules/aws-sign2):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename ‘/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/aws-sign2’ -> '/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/.aws-sign2.DELETE’
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: aws4@1.6.0 (node_modules/nativescript/node_modules/fsevents/node_modules/aws4):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename ‘/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/aws4’ -> ‘/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/.aws4.DELETE’

npm ERR! path /usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/balanced-match
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename ‘/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/balanced-match’ -> '/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/.balanced-match.DELETE’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent


#2

@berlonce
how did you install node?
with homebrew, or without homebrew?


#3

Without. Just using the installer from the Node site.


#4

that explains.
the issues you are facing is because of improper permissions.
I would highly recommend you to use homebrew.

Also, it will be better to install nvm, so that you can switch node versions when you want.


#5

uninstall your current installation of node then follow this tutorial

brew update
brew install nvm
mkdir ~/.nvm
nano ~/.bash_profile

In your .bash_profile file (you may be using an other file, according to your shell), add the following :

export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh

Back to your shell, activate nvm and check it :

source ~/.bash_profile
echo $NVM_DIR

now you can install node simply by doing

nvm install 8.9.1

that should setup all the right permissions for you. :slight_smile:


#6

Thanks I’ll try that.


#7

Worked. Thanks. Would be nice if the NativeScript docs specifically pointed out the need for homebrew.


#8

it hasn’t been pointed out because there is no specific need for homebrew. it’s just that you have to configure permissions manually if you don’t use homebrew.