2016-03-11 160 views
1

我試圖建立使用泊塢一個ASP.Net 5.0 Web應用程序,但是當它到達故宮安裝步驟,它失敗:泊塢窗NPM安裝失敗

Step 14 : RUN npm install 
---> Running in 15c191d1ca1d 
npm WARN deprecated [email protected]: Please use Karma directly: https://github.com/karma-runner/gulp-karma 
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to [email protected]^4.0.0 as soon as possible. 
npm WARN deprecated [email protected]: [email protected]<3.0.0 is no longer maintained. Upgrade to [email protected]^4.0.0. 
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to [email protected]^4.0.0 as soon as possible. 
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to [email protected]^4.0.0 as soon as possible. 
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm 
npm WARN prefer global [email protected] should be installed with -g 
npm WARN prefer global [email protected] should be installed with -g 

> [email protected] install /app/src/CDWebDesigner/node_modules/node-sass 
> node scripts/install.js 

Binary downloaded and installed at /app/src/CDWebDesigner/node_modules/node-sass/vendor/linux-x64-11/binding.node 

> [email protected] postinstall /app/src/CDWebDesigner/node_modules/spawn-sync 
> node postinstall 

Installing native dependencies (this may take up to a minute) 

> [email protected] postinstall /app/src/CDWebDesigner/node_modules/node-sass 
> node scripts/build.js 



The command 'npm install' returned a non-zero code: 1 

ERROR: Build failed with: exit status 1 

我看不到任何錯誤這裏解釋了爲什麼它失敗,只有WARNings。我認爲這必須是npm安裝或其試圖安裝的模塊的問題。 [email protected]表示,將在新的NPM安裝失敗,但我不知道如何更新此,或依賴的是拉這個。

Dockerfile

FROM microsoft/aspnet:1.0.0-rc1-final 

RUN apt-get update && apt-get install -y curl 
RUN curl -sL https://deb.nodesource.com/setup | bash - 
RUN apt-get install -y nodejs 
RUN apt-get install bzip2 

RUN curl -L https://npmjs.org/install.sh | sh 

# Install bower 
RUN npm install -g bower 

# Install Gulp 
RUN npm install -g gulp 

# Install Git (for bower) 
RUN apt-get -y install git 

COPY . /app 
WORKDIR /app 
RUN ["dnu", "restore"] 

WORKDIR ./src/myapp 

RUN ["npm", "install"] 
RUN ["bower", "install", "--allow-root"] 
RUN ["gulp", "prod"] 

EXPOSE 5000 
CMD dnx kestrel 

的package.json

{ 
    "name": "ASP.NET", 
    "version": "0.0.0", 
    "devDependencies": { 
    "gulp": "3.8.11", 
    "gulp-concat": "2.5.2", 
    "gulp-cssmin": "0.1.7", 
    "gulp-uglify": "1.2.0", 
    "del": "^2.2.0", 
    "gulp-sass": "^2.0.4", 
    "gulp-typescript": "~2.8.0", 
    "main-bower-files": "~2.9.0", 
    "gulp-sourcemaps": "~1.5.2", 
    "mocha": "~2.2.5", 
    "gulp-mocha": "~2.1.3", 
    "karma-chai": "~0.1.0", 
    "chai": "~3.2.0", 
    "karma": "~0.13.9", 
    "karma-jasmine": "~0.3.6", 
    "karma-phantomjs-launcher": "~0.2.1", 
    "karma-spec-reporter": "~0.0.20", 
    "gulp-karma": "^0.0.4", 
    "gulp-js-obfuscator": "~1.0.0", 
    "gulp-order": "^1.1.1", 
    "gulp-debug": "^2.1.2" 
    } 
} 

回答

2

不知道,但1:你可以嘗試使用sudo NPM安裝安裝,和第二,你可以嘗試安裝在這臺機器節點GYP和pyton 2.7。如果模塊在安裝期間需要編譯節點擴展,那麼您將需要這兩件事。

3rd。我們通常如何調試:在失敗命令之前在狀態上創建映像。使用交互式shell運行容器(使用-it)。在裏面登錄。並手動運行npm install。看到並理解那裏的輸出。固定。

+0

謝謝。我將該映像構建到失敗的命令之前,並手動運行npm install,以提供有關錯誤的更多信息 - 存在一些相互衝突的依賴關係。 – user882807