【问题标题】:How to install npm in thimble如何在顶针中安装 npm
【发布时间】:2015-09-17 14:15:21
【问题描述】:

我尝试按照说明here 安装顶针。我成功安装了 Bramble,但是当我尝试在顶针中安装 npm 时,显示此错误:

C:\Users\Askar\Documents\GitHub> cd .\thimble.webmaker.org
C:\Users\Askar\Documents\GitHub\thimble.webmaker.org [bramble +1 ~0 -0 !]> npm install
|
> thimble@2.0.0 postinstall C:\Users\Askar\Documents\GitHub\thimble.webmaker.org

> bower install && node_modules/.bin/grunt requirejs:dist

'node_modules' is not recognized as an internal or external command, operable program or batch file.

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.1.0
npm ERR! npm  v2.14.3
npm ERR! code ELIFECYCLE
npm ERR! thimble@2.0.0 postinstall: `bower install && node_modules/.bin/grunt requirejs:dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the thimble@2.0.0 postinstall script 'bower install && node_modules/.bin/grunt requirejs:dist'.
npm ERR! This is most likely a problem with the thimble package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     bower install && node_modules/.bin/grunt requirejs:dist
npm ERR! You can get their info via:
npm ERR!     npm owner ls thimble
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Askar\Documents\GitHub\thimble.webmaker.org\npm-debug.log
C:\Users\Askar\Documents\GitHub\thimble.webmaker.org [bramble +1 ~0 -0 !]>

我该如何解决这个错误?

【问题讨论】:

    标签: node.js gruntjs requirejs npm


    【解决方案1】:

    postInstall 脚本失败(至少在 Windows 上)存在问题,因为第一个命令使脚本导航到运行 bower 命令的文件夹(cmd 以相同的路径运行所有后续命令? )。在修复此问题后,您可以自己运行命令

    npm install //this will fail
    "node_modules/.bin/bower" install
    "node_modules/.bin/grunt" requirejs:dist
    

    或者如果你已经全局安装了bowergrunt (npm install -g bower grunt-cli),你可以这样做

    bower install
    grunt install
    

    编辑:这个问题现在已经在最新的 master 中修复了

    【讨论】:

      猜你喜欢
      • 2023-02-09
      • 2014-06-15
      • 2022-01-17
      • 2016-09-05
      • 2017-10-30
      • 2021-04-11
      • 1970-01-01
      • 1970-01-01
      • 2011-11-27
      相关资源
      最近更新 更多