리자

Error: Cannot find module 'express'

모듈을 -g 로 설치했는데 모듈을 못찾는 경우가 있습니다.

 

$ node meadowlark.js 

module.js:339

    throw err;

    ^

 

Error: Cannot find module 'express'

    at Function.Module._resolveFilename (module.js:337:15)

    at Function.Module._load (module.js:287:25)

    at Module.require (module.js:366:17)

    at require (module.js:385:17)

    at Object.<anonymous> (/home/kagla/www/nodejs/web/ch05/meadowlark.js:1:77)

    at Module._compile (module.js:435:26)

    at Object.Module._extensions..js (module.js:442:10)

    at Module.load (module.js:356:32)

    at Function.Module._load (module.js:311:12)

    at Function.Module.runMain (module.js:467:10)

 

 

이때는 /usr/local/lib/load_modules 의 심볼릭 링크를 /usr/local/lib/node 로 하나 생성합니다.

 

ln -s /usr/local/lib/node_modules /usr/local/lib/node

 

 

그럼 정상적으로 실행이 될것 입니다.

 

$ node meadowlark.js 

Express started on http://localhost:3000; press Ctrl-C to terminate.

 

|

댓글 1개

+1
댓글을 작성하시려면 로그인이 필요합니다.

자유게시판

+
제목 글쓴이 날짜 조회
10년 전 조회 1,089
10년 전 조회 1,103
10년 전 조회 1,120
10년 전 조회 984
10년 전 조회 1,428
10년 전 조회 1,882
10년 전 조회 1,163
10년 전 조회 2,614
10년 전 조회 3,632
10년 전 조회 1,862
10년 전 조회 1,693
10년 전 조회 1,732
10년 전 조회 1,129
10년 전 조회 1,150
10년 전 조회 1,214
10년 전 조회 1,143
10년 전 조회 2,376
10년 전 조회 1,455
10년 전 조회 1,958
10년 전 조회 1,302
10년 전 조회 1,281
10년 전 조회 1,231
10년 전 조회 1,148
10년 전 조회 1,120
10년 전 조회 1,296
10년 전 조회 1,076
10년 전 조회 1,305
10년 전 조회 1,671
10년 전 조회 1,152
10년 전 조회 1,487