Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js Vue CLI安装问题_Node.js_Vue.js_Vuejs2_Command Line Interface - Fatal编程技术网

Node.js Vue CLI安装问题

Node.js Vue CLI安装问题,node.js,vue.js,vuejs2,command-line-interface,Node.js,Vue.js,Vuejs2,Command Line Interface,我正在学习Vue.JS,需要安装Vue CLI NodeJS:v13.8.0 Vue CLI:v4.2.2 我安装NodeJS没有问题,但当我转到终端上的文件夹并使用(npm install-g@Vue/CLI)安装Vue CLI时,我遇到了很多错误 MacBook-Pro-de-Cedric:excli cedric$ npm install -g @vue/cli npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer m

我正在学习Vue.JS,需要安装Vue CLI

NodeJS:v13.8.0 Vue CLI:v4.2.2

我安装NodeJS没有问题,但当我转到终端上的文件夹并使用(npm install-g@Vue/CLI)安装Vue CLI时,我遇到了很多错误

MacBook-Pro-de-Cedric:excli cedric$ npm install -g @vue/cli
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/@vue/cli
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/@vue/cli/node_modules
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/@vue
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules/@vue/cli
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/@vue/cli'
npm ERR!  [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/@vue/cli'] {
npm ERR!   stack: "Error: EACCES: permission denied, access '/usr/local/lib/node_modules/@vue/cli'",
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules/@vue/cli'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/cedric/.npm/_logs/2020-02-09T15_09_00_595Z-debug.log
如果有人知道我如何解决这个问题,那就太好了。
感谢如果您在mac上,请尝试
sudo npm install-g@vue/cli
而不是
npm install-g@vue/cli
进行全局安装。

如果您在mac上,请尝试
sudo npm install-g@vue/cli
而不是
npm install-g@vue/cli
进行全局安装。

这是从节点路径开始的模块丢失,您可以键入
sudo npm install-g@vue/cli
安装vue,这意味着在全局环境下安装vue,也可以重新设置节点模块路径。

由于节点模块的路径丢失,您可以键入
sudo npm install-g@vue/cli
安装vue,这意味着在全局环境下安装vue,或者您可以重新设置节点模块路径。

您必须使用超级用户权限执行
npm install-g
(例如在linux上使用
sudo
),因为您的npm目录似乎在超级用户权限下


您还可以

您必须使用超级用户权限执行
npm install-g
(例如在linux上使用
sudo
),因为您的npm目录似乎在超级用户权限下


您也可以

这些错误看起来与Vue CLI没有直接关系。它们看起来像是npm设置的问题。你可能需要在谷歌上搜索与npm、macOS相关的答案,就像许多错误都包含在问题中一样……EACCES意味着你需要使用sudo或为用户安装npm,例如google around
如何在macOS上安装nvm
其他部分是gyp eror感谢所有的答案,我发现了问题。我试图在一个目录上创建一个项目。当我在/user/myname上创建它时,它就工作了!这些错误看起来与Vue CLI没有直接关系。它们看起来像是npm设置的问题。你可能需要在谷歌上搜索与npm、macOS相关的答案,就像许多错误都包含在问题中一样……EACCES意味着你需要使用sudo或为用户安装npm,例如google around
如何在macOS上安装nvm
其他部分是gyp eror感谢所有的答案,我发现了问题。我试图在一个目录上创建一个项目。当我在/user/myname上创建它时,它就工作了!
gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/cedric/Documents/Projets Site Web : Apps/VueJs/excli/projet/node_modules/fsevents
gyp ERR! node -v v13.8.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 

Successfully created project projet.
Get started with the following commands:

 $ cd projet
 $ npm run serve

MacBook-Pro-de-Cedric:excli cedric$ npm run serve
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/cedric/Documents/Projets Site Web : Apps/VueJs/excli/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/cedric/Documents/Projets Site Web : Apps/VueJs/excli/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/cedric/.npm/_logs/2020-02-09T15_18_01_082Z-debug.log