Node.js npm i-g nativescript错误

Node.js npm i-g nativescript错误,node.js,nativescript,Node.js,Nativescript,当我试图通过运行sudo npm I-g NativeScript来更新我的NativeScript时,我得到了以下错误。有没有办法开始解决这个问题 > nativescript@6.0.2 preuninstall /usr/local/lib/node_modules/nativescript > node preuninstall.js /usr/local/bin/tns -> /usr/local/lib/node_modules/nativescript/bin/

当我试图通过运行sudo npm I-g NativeScript来更新我的NativeScript时,我得到了以下错误。有没有办法开始解决这个问题

> nativescript@6.0.2 preuninstall /usr/local/lib/node_modules/nativescript
> node preuninstall.js

/usr/local/bin/tns -> /usr/local/lib/node_modules/nativescript/bin/tns
/usr/local/bin/nativescript -> /usr/local/lib/node_modules/nativescript/bin/tns

> fsevents@1.2.9 install /usr/local/lib/node_modules/nativescript/node_modules/fsevents
> node install

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.9 and node@10.16.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/nativescript/node_modules/fsevents/lib' 
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: EPERM: operation not permitted, utime '/Users/xxx/.node-gyp/10.16.0'
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/Cellar/node@10/10.16.0/bin/node" "/usr/local/Cellar/node@10/10.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/nativescript/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/nativescript/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd /usr/local/lib/node_modules/nativescript/node_modules/fsevents
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node@10/10.16.0/bin/node /usr/local/Cellar/node@10/10.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/nativescript/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/nativescript/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Darwin 18.7.0
node-pre-gyp ERR! command "/usr/local/Cellar/node@10/10.16.0/bin/node" "/usr/local/lib/node_modules/nativescript/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/nativescript/node_modules/fsevents
node-pre-gyp ERR! node -v v10.16.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/Cellar/node@10/10.16.0/bin/node /usr/local/Cellar/node@10/10.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/nativescript/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/nativescript/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)

使用npm i-g nativescript-不安全的perm工作。不安全的烫发选项当然不是解决问题的最正确方法,但它确实有效

尝试使用不安全的权限npm i-g nativescript-不安全的Perm,但确实有效。我确实觉得我使用了不安全的烫发,犯了一些不可原谅的罪,但我真的无法让它正常工作。