npm 运行 构建错误,没有那个文件或目录,打开 'build/bundle.css'

npm run build error, no such file or directory, open 'build/bundle.css'

我正在尝试在 node package-manager 支持的本地主机产品上对自定义 WordPress 安装进行例行测试。在实例化 WordPress 核心文件、确保成功连接到数据库并更新一些资产之后,我尝试将目录更改为相应的 WordPress 主题文件到 运行 node-package-manager install 命令 npm install(成功)然后尝试按照例程使用 npm run build 执行 CSS-编译器;然而,在这次尝试中,我在下面的终端输出中遇到了以下错误:

vetsi npm run build

> @ build /Users/alexsingleton/Sites/vetsi/wp-content/themes/vetsi
> npm-run-all --silent compile:css compile:js

/Users/alexsingleton/Sites/vetsi/wp-content/themes/vetsi/node_modules/stylus/bin/stylus:715
    if (err) throw err;
             ^

Error: ENOENT: no such file or directory, open 'build/bundle.css'
    at Error (native)
ERROR: compile:css: None-Zero Exit(1);

npm ERR! Darwin 16.4.0
npm ERR! argv "/Users/alexsingleton/.nvm/versions/node/v4.4.4/bin/node" "/Users/alexsingleton/.nvm/versions/node/v4.4.4/bin/npm" "run" "build"
npm ERR! node v4.4.4
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ build: `npm-run-all --silent compile:css compile:js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ build script 'npm-run-all --silent compile:css compile:js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm-run-all --silent compile:css compile:js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/alexsingleton/.npm/_logs/2017-02-15T17_48_20_907Z-debug.log
➜  vetsi

我已尝试使用 npm install -g npm 更新节点包管理器,并使用 nvm ls 验证了与另一个成功的本地主机生产相对应的正确版本,生成以下输出:

vetsi nvm ls
        v0.12.7
->       v4.4.4
         system
default -> 4.4.4 (-> v4.4.4)
node -> stable (-> v4.4.4) (default)
stable -> 4.4 (-> v4.4.4) (default)
iojs -> iojs- (-> N/A) (default)
➜  vetsi

不用说,尽管我可以成功访问 WordPress 内容管理系统并在其中导航,但上述错误会阻止呈现任何本地主机页面。如果有任何指导,我将不胜感激 - 谢谢!

在 Google Chrome Inspector Tools 的控制台中调查 localhost-production 后,错误报告说整个 node package-manager folder and dependencies 都丢失了。由于 npm-installnpm build 都没有实例化 package-folder 或依赖项,我只是从我的其他工作本地主机产品中复制文件,特别是 bundle.css 它显然在适当的路径中丢失 (wp/themes/vetsi/build)。目前,这个 hack 是解决我的问题的最佳方法,但我欢迎其他分析或澄清为什么上述命令没有根据我以前的成功正确执行。谢谢!