在运行如下命令时, 遇到了问题:

npm install --registry=https://registry.npm.taobao.org

npm run dev

错误提示:

解决办法: 生成一个package.json文件

C:\Users\James>npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

然后根据提示一步一步的设置package.json中的内容, 就可以生成这个文件.

之后又遇到了另一个问题:

打开package.js文件夹,发现文件夹里的scripts有dev如下图:

可就是好不到,什么原因呢?最后一看路径不对,vue init webpack my-project时,自己又建立一个文件夹,取不到对应的package.js中的dev.

cd 到对应文件夹,重新运行npm run dev 就OK了。

还有一种情况,打开的是当前文件夹,但是文件夹package.js里的scripts确实没有dev,

输入vue init webpack  将package.json中丢失的:

"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
    "start": "npm run dev",
    "build": "node build/build.js"

重新下载过来,然后在npm intall 安装依赖,最后 npm run dev即可

也适用于解决start, build丢失

接下来又遇到了这个问题:

C:\Users\James>npm run dev
npm ERR! missing script: dev npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\James\AppData\Roaming\npm-cache\_logs\2019-06-19T03_42_09_738Z-debug.log

原文:https://blog.csdn.net/dt1991524/article/details/82985570

原文:https://blog.csdn.net/oldthree1/article/details/88343076
  

npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\James\package.json'的更多相关文章

  1. npm WARN saveError ENOENT: no such file or directory

    转自树之名原文npm WARN saveError ENOENT: no such file or directory解决 我是在安装sequelize时出错的.提示的错误没有保存,类似于参考的文章中 ...

  2. npm install报错类似于npm WARN tar ENOENT: no such file or directory, open '***\node_modules\.staging\***

    报错类似于如下图 解决方法: 删除文件 package-lock.json,再重新执行npm i或者npm install

  3. npm saveError ENOENT: no such file or directory

    1.报错情况 在执行npm install xxx时,出现如下:npm WARN saveError ENOENT: no such file or directory, open '/nodetes ...

  4. npm安装socket.io时报错的解决方法(npm WARN enoent ENOENT: no such file or directory, open '/usr/local/nodejs/bin/package.json')

    执行 npm install socket.io安装时报错: [root@WEB node_modules]# npm install socket.ionpm WARN enoent ENOENT: ...

  5. npm install报错 npm ERR! enoent ENOENT: no such file or directory

    在npm之后出现如下错误: $ npm install npm WARN checkPermissions Missing write access to /Users/lucas/code/js/v ...

  6. cnmp安装失败,报错npm ERR! enoent ENOENT: no such file or directory,

    1.cnmp安装失败 2.提示如下: bogon:node_modules liangjingming$ sudo npm install cnpm -g --registry=https://reg ...

  7. 解决Error: ENOENT: no such file or directory, scandir 'D:\IdeaWork\code-front-jet\node_modules\.npminstall\node-sass\3.7.0\node-sass\vendor'

    在使用npm安装node-sass的时候,可能会出现如下的报错: Error: ENOENT: no such file or directory, scandir 'D:\IdeaWork\code ...

  8. 【应用服务 App Service】NodeJS +Egg 发布到App Service时遇见 [ERR_SYSTEM_ERROR]: A system error occurred:uv_os_get_passwd returned ENOENT(no such file or directory)

    问题情形 本地NodeJS应用使用Egg脚手架构建,本地运行测试完全没有问题,发布后App Service后不能运行.通过登录到kudu后(https://<your web site>. ...

  9. gitbook build/serve 失败,Error: ENOENT: no such file or directory, stat ...

    我使用的 gitbook 版本 CLI version: 2.3.2 GitBook version: 3.2.3 在使用 gitbook 生成文档时,发现编译偶尔不规律性地出现错误 d:\Mine\ ...

随机推荐

  1. javascript中的scroll事件

    window.addEventListener('scroll',function(){ if(document.compatMode == "CSS1Compat") { ale ...

  2. int **指针问题

    转自:http://blog.csdn.net/u012501459/article/details/45395571 在打印二维数组时遇到了问题,二维数组可以这样定义int matrix[ROWS] ...

  3. 327. Count of Range Sum(inplace_marge)

    Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Ra ...

  4. 微调Inception V3网络-对Satellite分类

    目录 1. 流程概述 2. 准备数据集 2.1 Satellite数据集介绍 3. Inception V3网络 4. 训练 4.1 基于Keras微调Inception V3网络 4.2 Keras ...

  5. 以太坊开发教程(二) 利用truffle发布宠物商店 DAPP 到 以太坊测试环境Ropsten

    1.环境安装 1) node安装 设置镜像地址: curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -下载安装 ...

  6. 2017-9-9 NOIP模拟赛

    站军姿 2bc*cosA=b^2+c^2-a^2 #include<cstdio> #include<cstdlib> #include<cmath> #inclu ...

  7. 洛谷2105 k皇后

    P2105 K皇后 题目描述 小Z最近捡到了一个棋盘,他想在棋盘上摆放K个皇后.他想知道在他摆完这K个皇后之后,棋盘上还有多少了格子是不会被攻击到的. (Ps:一个皇后会攻击到这个皇后所在的那一行,那 ...

  8. Java工程打包成jar可执行文件

    将一个工程中的类打包成jar文件,步骤参考如下: 1.选择file -> project structure 2. 选择Arifacts->JAR->form modules wit ...

  9. 搞定C系语言的的swap

    http://www.cs.utsa.edu/~wagner/CS2213/swap/swap.html 原地址 Parameters, by value and by reference: Both ...

  10. Django框架之MVT(1)

    Django框架之MVT 灌输: 什么是根目录:就是没有路径,只有域名.  url(r”^$”) 一.     MVT模型 Django的MVT模型 -     Model(模板):和数据库相关,负责 ...