修改package.json中的name属性后,再打包就报错
原来的package.json
如下所示:
{
"name": "aaa",
"version": "1.0.0",
"description": "aaa 打包",
"scripts": {
"debug": "cross-env NODE_ENV=development gulp",
"release": "cross-env NODE_ENV=production gulp"
},
"dependencies": {
"gulp": "^3.9.1"
},
"devDependencies": {
"cross-env": "^5.0.1",
"gulp-changed": "^3.1.0",
"gulp-concat": "^2.6.1",
"gulp-debug": "^3.1.0",
"gulp-footer": "^1.0.5",
"gulp-if": "^2.0.2",
"gulp-ignore": "^2.0.2",
"gulp-jade": "^1.1.0",
"gulp-less": "^3.3.2",
"gulp-rename": "^1.2.2",
"lazypipe": "^1.0.1",
"merge-stream": "^1.0.1"
}
}
我先通过npm install
安装所有依赖后,执行命令npm run release
程序使用正常,但是发现打包的名称不对,然后修改了name
和description
之后,再执行命令npm run release
就报错了:Invaild name!
,如下:
{
"name": "bbb",
"version": "1.0.0",
"description": "bbb 打包",
"scripts": {
"debug": "cross-env NODE_ENV=development gulp",
"release": "cross-env NODE_ENV=production gulp"
},
"dependencies": {
"gulp": "^3.9.1"
},
"devDependencies": {
"cross-env": "^5.0.1",
"gulp-changed": "^3.1.0",
"gulp-concat": "^2.6.1",
"gulp-debug": "^3.1.0",
"gulp-footer": "^1.0.5",
"gulp-if": "^2.0.2",
"gulp-ignore": "^2.0.2",
"gulp-jade": "^1.1.0",
"gulp-less": "^3.3.2",
"gulp-rename": "^1.2.2",
"lazypipe": "^1.0.1",
"merge-stream": "^1.0.1"
}
}
请问,我如果想修改名称'aaa'为'bbb',应该怎么做?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道了,
package.json
的name
属性值不能包含空格,我把空格去掉就好了,谢谢michael_cai
的回答。把错误信息以及gulp的相关task代码发出来。