我删除了〜/ package.json,现在我尝试安装此SwitchyOmega。 第一步工作正常
# Install node and npm first (make sure npm --version > 2.0), then:
sudo npm install -g grunt-cli bower
但下一步
# In the project folder:
cd omega-build
npm run deps # This runs npm install in every module.
npm run dev # This runs npm link to aid local development.
给我这个错误
npm ERR! path /Users/Rahimi/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/Rahimi/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! /Users/Rahimi/.npm/_logs/2017-09-17T04_55_31_851Z-debug.log
答案 0 :(得分:0)
您尝试运行的脚本命令出现在package.json
中,如下所示。
"scripts": {
"deps": "npm install && (cd ../omega-pac && npm install) && (cd ../omega-target && npm install) && (cd ../omega-web && npm install && bower install) && (cd ../omega-target-chromium-extension/ && npm install)",
"dev": "(cd ../omega-pac && npm run dev) && (cd ../omega-target && npm run dev) && (cd ../omega-web && npm run dev) && (cd ../omega-target-chromium-extension/ && npm run dev)"
}
如果删除package.json
,您将无法运行这些命令。您需要package.json
通过脚本命令安装软件包。
要在没有package.json
的情况下执行此操作,您必须导航到命令deps
中提到的每个文件夹并运行npm install
以安装pacakges。通过导航到主dev
命令中的提到的文件夹来运行dev
命令。这是相当多的工作,最好保留pacakge.json
并使用脚本命令。