美文网首页
启动vue项目报错:npm ERR! enoent ENOENT

启动vue项目报错:npm ERR! enoent ENOENT

作者: 吴wuwu | 来源:发表于2020-07-28 15:52 被阅读0次

    1、在VSCode用npm run serve运行项目时报错,报错信息如下:

    npm ERR! code ENOENT

    npm ERR! syscall open

    npm ERR! path C:\xxx\xx\xx\package.json

    npm ERR! errno -4058

    npm ERR! enoent ENOENT: no such file or directory, open 'C:\xxx\xx\xx\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!    C:\Users\

    2、原因:

    报错原因是我没有进入到项目文件夹下进行 npm install ,在项目文件夹外一层直接 npm install 去了。。导致项目没有真正添加包依赖,项目文件夹里也没有生成package.josn文件,所以找不到,然后报了上面的错。

    3、解决:

    先    cd 项目名称   进入项目文件目录,再进行依赖包安装 npm install ,最后再启动就没问题了 npm run serve 。

    相关文章

      网友评论

          本文标题:启动vue项目报错:npm ERR! enoent ENOENT

          本文链接:https://www.haomeiwen.com/subject/rjwfrktx.html