0
votes

I'm trying to install NativeScript and I am getting this error when I do

npm i -g nativescript

npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\John\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "i" "-g" "nativescript" npm ERR! node v8.9.1 npm ERR! npm v4.0.3

npm ERR! Cannot read property 'assert-plus' of undefined

. . .

npm ERR! Cannot read property 'minimist' of undefined

when I run this command on a Mac, I get:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (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 ERR! path /usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/ansi-regex 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/ansi-regex' -> '/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/.ansi-regex.DELETE' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent

Does anyone know how to work around this? I have the latest version of Node and npm. Maybe that is my problem? Does anyone know what version would work? Thanks!

2

2 Answers

0
votes

Since you are using windows you need to run this for installation

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://www.nativescript.org/setup/win'))"

See https://docs.nativescript.org/start/quick-setup section Windows

0
votes

This was interesting to me. I had had npm 4.01 on the Windows machine and getting the lastest (npm i -g npm@latest), 5.5.1, made it work. On the Mac machine I already had 5.5.1 but rolling that back to 4.1.1 allowed the install to work. So on Windows, 5.5.1 was good but not on the Mac.