[英]Unforseen errors when running sudo npm install -g @vue/cli
除了他危险的子弹头chown -R
解决方案,我还尝试了网络上的所有解决方案,以通过cli
启动vue.js
并vue.js
运行。
据说,我没有权限操作npm
文件夹,但我又不太确定了。
在Terminal
,出现以下错误。 我已经Google一步一步地搜索了错误,尝试了一些可能的解决方案,但没有任何效果。
我该怎么做才能解决此问题?
node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.4 and node@11.3.0 (node-v67 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/jamf/bin/lib/node_modules/@vue/cli/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64'
gyp ERR! clean error
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build'
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/jamf/bin/jamf/node" "/usr/local/jamf/bin/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "clean"
gyp ERR! cwd /usr/local/jamf/bin/lib/node_modules/@vue/cli/node_modules/fsevents
gyp ERR! node -v v11.3.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/jamf/bin/jamf/node /usr/local/jamf/bin/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js clean' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/jamf/bin/lib/node_modules/@vue/cli/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:978:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command "/usr/local/jamf/bin/jamf/node" "/usr/local/jamf/bin/lib/node_modules/@vue/cli/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/jamf/bin/lib/node_modules/@vue/cli/node_modules/fsevents
node-pre-gyp ERR! node -v v11.3.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/jamf/bin/jamf/node /usr/local/jamf/bin/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js clean' (1)
npm WARN @apollographql/apollo-upload-server@5.0.3 requires a peer of graphql@^0.13.1 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/@vue/cli/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ @vue/cli@3.2.1
您可以使用chown -R
选项。 因为它试图访问的文件夹是由另一个进程创建的,所以您的用户帐户不是所有者,因此无法在其中进行更改。 使用chown -R
,只需将文件夹的所有权更改为用户即可,这并不危险。 我必须在新笔记本电脑上做几次npm。
您要使用的命令是:
sudo chown <username> -R ./*
我认为,在文件夹: /usr/local/jamf/bin/lib
,如果这样不起作用,请尝试上/usr/local/jamf/bin/lib
一个文件夹并在其中使用相同的命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.