2017-05-10 3 views
1
내가 터미널 역할을 NG 를 사용하여 내 터미널이 오류가 계속

, 이미 ='npm install portfinder, 또한 npm uninstall -g angular-cli, npm cache clean, npm install npm -g, npm install -g angular-cli 있지만 없음 작업을 시도하고 내가 계속 난 portfinder를 설치 한 후 모듈 'portfinder'를 찾을 수 없습니다가 계속 그것을 받고, 내가 NPM 3.10.10을 사용하고, Angular4 아래와 같이 오류가 :각도 4 - 수동으로

Cannot find module 'portfinder' 
Error: Cannot find module 'portfinder' 
    at Function.Module._resolveFilename (module.js:469:15) 
    at Function.Module._load (module.js:417:25) 
    at Module.require (module.js:497:17) 
    at require (internal/module.js:20:19) 
    at Object.<anonymous> (/usr/local/lib/node_modules/angular-cli/commands/serve.js:6:18) 
    at Module._compile (module.js:570:32) 
    at Object.Module._extensions..js (module.js:579:10) 
    at Module.load (module.js:487:32) 
    at tryModuleLoad (module.js:446:12) 
    at Function.Module._load (module.js:438:3) 
    at Module.require (module.js:497:17) 
    at require (internal/module.js:20:19) 
    at Class.includedCommands (/usr/local/lib/node_modules/angular-cli/addon/index.js:21:16) 
    at /usr/local/lib/node_modules/angular-cli/node_modules/angular-cli/lib/models/project.js:392:61 
    at Array.forEach (native) 
    at Project.addonCommands (/usr/local/lib/node_modules/angular-cli/node_modules/angular-cli/lib/models/project.js:391:15) 
    at Project.eachAddonCommand (/usr/local/lib/node_modules/angular-cli/node_modules/angular-cli/lib/models/project.js:426:30) 
    at module.exports (/usr/local/lib/node_modules/angular-cli/node_modules/angular-cli/lib/cli/lookup-command.js:33:13) 
    at CLI.<anonymous> (/usr/local/lib/node_modules/angular-cli/node_modules/angular-cli/lib/cli/cli.js:34:26) 
    at tryCatch (/usr/local/lib/node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/lib/rsvp/-internal.js:215:12) 
    at invokeCallback (/usr/local/lib/node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/lib/rsvp/-internal.js:230:13) 
    at publish (/usr/local/lib/node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/lib/rsvp/-internal.js:198:7) 
    at flush (/usr/local/lib/node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/lib/rsvp/asap.js:82:5) 
    at _combinedTickCallback (internal/process/next_tick.js:73:7) 
    at process._tickCallback (internal/process/next_tick.js:104:9) 

답변

1

좋아, 내가 문제를 해결, 문제는 내 컴퓨터에서 두 번 노드 (그 이유도 portfinder를 설치 한 후, 나는 여전히 'portfinder'모듈을 찾을 수 없다) 마법사 및 homebrew를 통해 노드를 설치하면 기본적으로 얻을 나는 사제와를 통해 노드를 설치

# first: 
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done 
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* 

# To recap, the best way (I've found) to completely uninstall node + npm is to do the following: 

# go to /usr/local/lib and delete any node and node_modules 
cd /usr/local/lib 
sudo rm -rf node* 

# go to /usr/local/include and delete any node and node_modules directory 
cd /usr/local/include 
sudo rm -rf node* 

# if you installed with brew install node, then run brew uninstall node in your terminal 
brew uninstall node 

# check your Home directory for any "local" or "lib" or "include" folders, and delete any "node" or "node_modules" from there 
# go to /usr/local/bin and delete any node executable 
cd /usr/local/bin 
sudo rm -rf /usr/local/bin/npm 
sudo rm -rf /usr/local/bin/node 
ls -las 

# you may need to do the additional instructions as well: 
sudo rm -rf /usr/local/share/man/man1/node.1 
sudo rm -rf /usr/local/lib/dtrace/node.d 
sudo rm -rf ~/.npm 

노드를 포함하는 모든 폴더가 지워지지이 방법 : 그래서, 기본적으로 다른 장소에서 설치, 내가 한 그래서 뭐, 내가 찾을이 방법을 통해 내 Mac에서 노드 폴더를 삭제 원사, 각도 cli, 반응 원주민 cli 등을 설치하십시오.

나는 이것을 공유 할 생각이었고, 다른 사람들을 돕기를 바랍니다. 그는 같은 문제입니다.

3

당신은 또 다른 대안은 각-CLI 폴더로 이동하고있다 portfinder를 설치하는 작업을 얻기 위해 노드에서 4.x 버전이 필요합니다 npm install portfinder. 로컬 npm 설치 portfinder가 문제를 해결하지 못하면 portfinder의 전역 설치가 작동합니다.

+0

노드의 경우 이미 v6입니다. – Alireza

+0

angular-cli 폴더로 이동하여 npm install portfinder를 사용하여 portfinder를 설치하십시오. – HarryJs

+0

나는 그것을 또한했다, 그러나 동일한 문제점은 남아있다! 그래서 이상한... – Alireza