2017-11-27 9 views
1

openshift에서 socket.io를 사용하여 node.js 서버를 빌드하는 동안 다음 오류가 발생합니다.openshift with socket.io, npm install에서 종속성을 읽을 수 없음

내가 다음 package.json

{ 
    "name": "socket_thing", 
    "version": "0.0.1", 
    "description": "To make a server plugin for superpowers", 
    "scripts": { 
    "start": "node server.js" 
    }, 
    "main": "server.js", 
    "dependencies": { 
    "express": "^4.15.2", 
    "socket.io": "^2.0.4" 
    } 
} 

을 사용하는 모든 오류없이 코드가 내 로컬 컴퓨터에서 잘 실행하지만

npm ERR! install Couldn't read dependencies 
npm ERR! install Couldn't read dependencies 
npm ERR! Linux 3.10.0-753.el7xtsync.x86_64 
npm ERR! argv "/opt/rh/rh-nodejs4/root/usr/bin/node" "/opt/rh/rh-nodejs4 /root/usr/bin/npm" "install" 
npm ERR! node v4.6.2 
npm ERR! npm v2.15.1 
npm ERR! file /opt/app-root/src/package.json 
npm ERR! code EJSONPARSE 

npm ERR! Failed to parse json 
npm ERR! Cannot find module './lib/parse' 
npm ERR! File: /opt/app-root/src/package.json 
npm ERR! Failed to parse package.json data. 
npm ERR! package.json must be actual JSON, not just JavaScript. 
npm ERR! 
npm ERR! This is not a bug in npm. 
npm ERR! Tell the package author to fix their package.json file. JSON.parse 

npm ERR! Please include the following file with any support request: 
npm ERR! /opt/app-root/src/npm-debug.log 

, 방법은 의존성이 다르게 처리됩니다 어떤 이유가 있습니까 opensshift에서 문제가있는 것 같습니다.

답변

0

그래서 package.json이 문제를 해결에

"express": "^4.16.2" 

명시

의 최신 버전을 사용하는 것으로 보인다.