やりたいこと
Angularでアプリを起動したいです.
実行環境
OS:Windows 7
以下はAngularに関わりそうなソフトウェアについて、です.
C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web>node -v v8.9.4 C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web>ng -v _ _ ____ _ ___ / \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _| / △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | | / ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | | /_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___| |___/ Angular CLI: 6.1.2 Node: 8.9.4 OS: win32 x64 Angular: 6.1.2 ... animations, cli, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router Package Version ----------------------------------------------------------- @angular-devkit/architect 0.7.2 @angular-devkit/build-angular 0.7.2 @angular-devkit/build-optimizer 0.7.2 @angular-devkit/build-webpack 0.7.2 @angular-devkit/core 0.7.2 @angular-devkit/schematics 0.7.2 @ngtools/webpack 6.1.2 @schematics/angular 0.7.2 @schematics/update 0.7.2 rxjs 6.2.2 typescript 2.7.2 webpack 4.9.2 C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web>npm -v 5.6.0
困っていること
npmでインストールしたパッケージの中に、過去モジュールだったが現在node.jsのcoreモジュールになっている(?)らしい
もの(fs, child_processなど)があり、起動時に以下のようなエラーメッセージが出てしまいます.
実行したコマンドは
ng serve
でした。
node.js
1ERROR in ./node_modules/cluster/lib/master.js 2Module not found: Error: Can't resolve 'child_process' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\cluster\lib' 3ERROR in ./node_modules/cluster/lib/worker.js 4Module not found: Error: Can't resolve 'child_process' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\cluster\lib' 5ERROR in ./node_modules/cluster/lib/master.js 6Module not found: Error: Can't resolve 'dgram' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\cluster\lib' 7ERROR in ./node_modules/native-dns-cache/lookup.js 8Module not found: Error: Can't resolve 'dgram' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\native-dns-cache' 9ERROR in ./node_modules/native-dns/lib/utils.js 10Module not found: Error: Can't resolve 'dgram' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\native-dns\lib' 11ERROR in ./node_modules/native-dns/lib/server.js 12Module not found: Error: Can't resolve 'dgram' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\native-dns\lib' 13ERROR in ./node_modules/cluster/lib/master.js 14Module not found: Error: Can't resolve 'fs' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\cluster\lib' 15ERROR in ./node_modules/cluster/lib/cluster.js 16Module not found: Error: Can't resolve 'fs' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\cluster\lib' 17ERROR in ./node_modules/cluster/lib/plugins/cli.js 18Module not found: Error: Can't resolve 'fs' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\cluster\lib\plugins' 19ERROR in ./node_modules/cluster/lib/plugins/logger.js 20Module not found: Error: Can't resolve 'fs' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\cluster\lib\plugins' 21ERROR in ./node_modules/cluster/lib/plugins/reload.js 22Module not found: Error: Can't resolve 'fs' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\cluster\lib\plugins' 23ERROR in ./node_modules/cluster/lib/plugins/pidfiles.js 24Module not found: Error: Can't resolve 'fs' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\cluster\lib\plugins' 25ERROR in ./node_modules/cluster/lib/plugins/stats.js 26Module not found: Error: Can't resolve 'fs' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\cluster\lib\plugins' 27ERROR in ./node_modules/log4js/lib/log4js.js 28Module not found: Error: Can't resolve 'fs' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\log4js\lib' 29ERROR in ./node_modules/mkdirp/index.js 30Module not found: Error: Can't resolve 'fs' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\mkdirp' 31ERROR in ./node_modules/native-dns/lib/platform.js 32Module not found: Error: Can't resolve 'fs' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\native-dns\lib' 33ERROR in ./node_modules/cluster/lib/master.js 34Module not found: Error: Can't resolve 'tty' in 'C:\Users\user\Desktop\pleiades\workspace\tm-root\task-manager-web\node_modules\cluster\lib'
ないからといってパッケージ名を指定してインストールしても、空のパッケージがインストールされてしまい、結局上記パッケージに依存しているパッケージが依存解決できない状態です.
試したこと
何個かやってみたけどさっぱりでした。。
fs
などはnode.jsのどこかのバージョンからcoreになっているということで、ひとまずエラーが出ているrequire('fs')
的な部分を全てコメントアウト
-> 当然ながら解析不可ということで起動できず
node_modules
を一回まるごと削除して、再度npm install
-> 上記エラーを取得し、未解決
その他
抜けばええやん、と言われそうですがパッケージにlo4js
を追加したところ、起動しなくなってしまいました.
※逆にいえば、それまではng serve
で起動できていました.
ウェブで検索しても、いまいち有益な情報が得られなかったので、質問いたしました.
知見をお貸しいただければ幸いです.
どうぞよろしくお願いいたします.
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/19 08:01
2018/08/19 14:12
2018/08/19 23:04
2018/08/20 00:13
2018/08/20 00:30