html - 我无法运行 npm run script 它显示了许多错误
问题描述
我尝试了很多次运行 npm 脚本 我还在package.json
文件中添加了脚本,但它显示了一些错误实际上我正在构建一个网站,我需要 npm sass 来制作它,但是compile:sass
我的脚本的 npm run 显示错误这是图像正面临问题。
这是脚本代码:
{
"name":"natours",
"version":"1.0.0",
"description":"landing page for natours",
"main":"index.js",
"scripts":{
"compile:sass":"node-sass sass/main.scss css/style.css" <=====
},
"author":"Kishan",
"license":"ISC",
"devDependencies":{
"node-sass":"^4.9.0"
}
}
这是命令提示符中的错误:
C:\Users\ANONYMOUS>npm run compile:sass
npm ERR! path C:\Users\ANONYMOUS\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\ANONYMOUS\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\ANONYMOUS\AppData\Roaming\npm-cache_logs\2018-06-17T05_39_21_109Z-debug.log C:\Users\ANONYMOUS>
解决方案
您在 node-sass sass/main.scss 和 css/style.css 之间缺少逗号
它应该是 node-sass sass/main.scss, css/style.css
推荐阅读
- python - 对列表和多次迭代的误解
- jquery - Update @Model using jQuery and diffrent controller/function
- php - 连接到 MySQL 时这些错误是什么?
- python - 任何人都知道如何编辑全局变量python?
- algorithm - 这个 n 体问题是 O(n^2) 还是 O(n log n)?
- r - 根据索引查找字符串
- c# - 服务器端点击的html按钮标签不起作用
- php - 无法在laravel gitlab ci中迁移数据库
- python-3.x - 如何在 Python 中反转一阶差分?
- python - 每次在 Kivy 中按下此特定按钮时,我都需要更改我的随机数