npm install hang on Mac OS X on Laravel 5 Project

npm install hang on Mac OS X on Laravel 5 Project

环境

⚡️  node -v                                                                                                                   
v8.9.4                                                                                                                              
⚡️  npm -v                                                                                                                    
5.6.0                                                                                                                               
⚡️  php -v                                                                                                                    
PHP 7.1.4 (cli) (built: May  6 2017 10:02:00) ( NTS )                                                                               
Copyright (c) 1997-2017 The PHP Group                                                                                               
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies                                                                       
    with Zend OPcache v7.1.4, Copyright (c) 1999-2017, by Zend Technologies                                                         

Mac OS X 10.12.6

我有这个 package.json

{
  "private": true,
  "devDependencies": {
    "grunt": "^1.0.1",
    "grunt-contrib-clean": "^1.0.0",
    "grunt-contrib-compress": "^1.4.1",
    "grunt-contrib-concat": "^1.0.1",
    "grunt-contrib-cssmin": "^1.0.2",
    "grunt-contrib-htmlmin": "^1.5.0",
    "grunt-contrib-uglify": "^1.0.2",
    "grunt-contrib-watch": "^1.0.0",
    "grunt-critical-css": "^0.1.3",
    "grunt-penthouse": "^0.3.0",
    "gulp": "^3.9.1",
    "laravel-elixir": "*"
  },
  "dependencies": {
    "angular-ckeditor": "^0.3.1",
    "grunt": "^1.0.1",
    "ng-tags-input": "^3.2.0"
  },
  "name": "gg-web-app",
  "version": "1.0.0",
  "main": "Gruntfile.js",
  "directories": {
    "test": "tests"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git+ssh://git@bitbucket.org/gg-web-app.git"
  },
  "author": "",
  "license": "ISC",
  "homepage": "https://bitbucket.org/gg-web-app#readme",
  "description": ""
}

我运行 npm 安装

我不断得到

> fsevents@1.1.3 install /Users/jdoe/Sites/jdoe/node_modules/fsevents
> node install

[fsevents] Success: "/Users/jdoe/Sites/jdoe/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
                                                                                                                                   
> phantomjs@1.9.11 install /Users/jdoe/Sites/jdoe/node_modules/phantomjs
> node install.js

WARN invalid config loglevel="notice"
Download already available at /var/folders/54/y_678c6n7q7_pgk1v5lkzwnr0000gp/T/phantomjs/phantomjs-1.9.7-macosx.zip
Extracting zip contents
Removing /Users/jdoe/Sites/jdoe/node_modules/phantomjs/lib/phantom
Copying extracted folder /var/folders/54/y_678c6n7q7_pgk1v5lkzwnr0000gp/T/phantomjs/phantomjs-1.9.7-macosx.zip-extract-1519572779384/phantomjs-1.9.7-macosx -> /Users/jdoe/Sites/jdoe/node_modules/phantomjs/lib/phantom

为什么和 phantomjs 的东西有关?

为什么挂了这么久?

是不是因为我上网的问题?

我不认为我在 package.json 中使用了任何太复杂的东西。

我已经在 npm 3.5.2node v8.2.1 和 Linux Ubuntu 17.10 上测试了您的 package.json。它在同一点挂起:

Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-1.9.7-linux-x86_64.tar.bz2
Receiving...
  [====================================----] 89% 0.0s
Received 12852K total.
Extracting tar contents (via spawned process)
Removing /home/***/Coding/test/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.7-linux-x86_64.tar.bz2-extract-1519592594804/phantomjs-1.9.7-linux-x86_64 -> /home/***/Coding/test/node_modules/phantomjs/lib/phantom

考虑在 https://github.com/ariya/phantomjs/issues

上写一个问题

可能的解决方案是 npm update 或检查 npm outdated 并手动更新到您的依赖项的新版本。就我而言,我有以下建议:

Package                 Current  Wanted  Latest     Location   
grunt-contrib-cssmin    1.0.2    1.0.2   2.2.1      gg-web-app
grunt-contrib-htmlmin   1.5.0    1.5.0   2.4.0      gg-web-app
grunt-contrib-uglify    1.0.2    1.0.2   3.3.0      gg-web-app
grunt-penthouse         0.3.0    0.3.0   0.4.0      gg-web-app
laravel-elixir          5.0.0    5.0.0   6.0.0-17   gg-web-app