/以下为所有运行的命令/
86188@Pping MINGW64 /
$ cd "project1"
bash: cd: project1: No such file or directory
86188@Pping MINGW64 /
$ cd "D:\wxapp"
86188@Pping MINGW64 /d/wxapp
$ cd "server\project1"
86188@Pping MINGW64 /d/wxapp/server/project1
$ npm init -y
Wrote to D:\wxapp\server\project1\package.json:
{
"name": "project1",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": ""
}
/以上为所有运行的命令/
/以下为开始出错的地方/
$ npm init -y
Wrote to D:\wxapp\server\project1\package.json:
{
"name": "project1",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": ""
}
你这是成功了,scripts下面的是可以被运行的脚本配置。你可以尝试npm run test来运行这个试试
不是报错
执行
npm init -y
是node项目初始化,生成一个package.json文件
执行命令之后
Wrote to D:\wxapp\server\project1\package.json:
{
"name": "project1",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo"Error: no test specified" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": ""
}
是将生成的package.json文件内容展开,
其中
"test": "echo"Error: no test specified" && exit 1"
是初始化之后并没有指定test命令要执行的内容,并不属于报错