리자

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.

 

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

Node.js

+
제목 글쓴이 날짜 조회
9년 전 조회 2,528
9년 전 조회 2,590
10년 전 조회 3,398
10년 전 조회 3,964
10년 전 조회 2,721
10년 전 조회 2,757
10년 전 조회 7,278
10년 전 조회 2,618
10년 전 조회 2,450
10년 전 조회 2,282
10년 전 조회 4,001
10년 전 조회 2,672
10년 전 조회 2,592
10년 전 조회 2,222
10년 전 조회 3,294
10년 전 조회 2,121
10년 전 조회 2,703
10년 전 조회 2,936
10년 전 조회 2,203
10년 전 조회 2,447
10년 전 조회 2,026
10년 전 조회 2,282
10년 전 조회 2,622
10년 전 조회 1,679
10년 전 조회 1,780
10년 전 조회 1,711
10년 전 조회 1,605
10년 전 조회 1,642
10년 전 조회 1,533
10년 전 조회 1,557