質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.46%
npm

npmは、Node Packaged Modulesの略。Node.jsのライブラリ・パッケージを管理できるツールです。様々なモジュールを簡単にインストールでき、自分でモジュールを作成し公開する際にも使用できます。

JSON

JSON(JavaScript Object Notation)は軽量なデータ記述言語の1つである。構文はJavaScriptをベースとしていますが、JavaScriptに限定されたものではなく、様々なソフトウェアやプログラミング言語間におけるデータの受け渡しが行えるように設計されています。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

Q&A

解決済

1回答

2181閲覧

npm run start時のエラーについて The 'cwd' optionとは

skillUp

総合スコア25

npm

npmは、Node Packaged Modulesの略。Node.jsのライブラリ・パッケージを管理できるツールです。様々なモジュールを簡単にインストールでき、自分でモジュールを作成し公開する際にも使用できます。

JSON

JSON(JavaScript Object Notation)は軽量なデータ記述言語の1つである。構文はJavaScriptをベースとしていますが、JavaScriptに限定されたものではなく、様々なソフトウェアやプログラミング言語間におけるデータの受け渡しが行えるように設計されています。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

0グッド

0クリップ

投稿2021/09/16 10:40

npm run start実行で
下記のエラーが出ます。
特にこの●1,2,3を解決したいのです。
ファイルに追記しているうちに、●2が表示されるようになり
追記以前の最初の状態に戻しても出続けてしまいます。
npmを再インストールをしても●2は出続けたため、
ファイルを削除し、最初からやり直したのですが
時折このエラーが出てしまいます。

このエラー含め3つの修正方法を教えていただけないでしょうか?

作業は下記を触っています。
https://github.com/puikinsh/Adminator-admin-dashboard

●1 × 「wdm」: assets by path *.html 236 KiB 19 assets

●2 ERROR in The 'cwd' option must be a path to a directory

●3 webpack 5.52.1 compiled with 1 error in 16220 ms
i 「wdm」: Failed to compile.
Watchpack Error (initial scan): Error: ENOTDIR: not a directory, scandir 'C:\Users\user\screen\adminator\src\index.js'

エラー -------------------------------------------- $ npm run start > adminator@2.0.0 start C:\Users\user\screen\adminator > webpack server --open i 「wds」: Project is running at http://localhost:8080/ i 「wds」: webpack output is served from / i 「wds」: Content not from webpack is served from C:\Users\user\screen\adminator\webpack\public i 「wdm」: wait until bundle finished: / × 「wdm」: assets by path *.html 236 KiB 19 assets assets by info 1.34 MiB [immutable] assets by path *.svg 666 KiB 2 assets assets by path *.eot 239 KiB 2 assets assets by path *.ttf 238 KiB asset 8b43027f47b20503057dfbbaa9401fef.eot 162 KiB [emitted] [immutable] [from: ../assets/static/fonts/icons/fontawesome/fontawesome-webfont.eot] (auxiliary name: main) asset 9bad94440d49256265a5b2305ec42d63.eot 76.9 KiB [emitted] [immutable] [from: ../assets/static/fonts/icons/themify/themify.eot] (auxiliary name: main) asset 1e59d2330b4c6deb84b340635ed36249.ttf 162 KiB [emitted] [immutable] [from: ../assets/static/fonts/icons/fontawesome/fontawesome-webfont.ttf] (auxiliary name: main) asset eda8b94308c6f538f04a8056ed761a57.ttf 76.7 KiB [emitted] [immutable] [from: ../assets/static/fonts/icons/themify/themify.ttf] (auxiliary name: main) assets by path *.woff 151 KiB asset f691f37e57f04c152e2315ab7dbad881.woff 95.7 KiB [emitted] [immutable] [from: ../assets/static/fonts/icons/fontawesome/fontawesome-webfont.woff] (auxiliary name: main) asset 29b39089170885ae29671a8c66d85a9f.woff 54.8 KiB [emitted] [immutable] [from: ../assets/static/fonts/icons/themify/themify.woff] (auxiliary name: main) asset main.js 6.46 MiB [emitted] (name: main) 1 related asset asset 20fd1704ea223900efa9fd4e869efb08.woff2 75.4 KiB [emitted] [immutable] [from: ../assets/static/fonts/icons/fontawesome/fontawesome-webfont.woff2] (auxiliary name: main) runtime modules 30.1 KiB 15 modules modules by path ../../node_modules/ 3.61 MiB 225 modules modules by path ../assets/ 2.51 MiB modules by path ../assets/scripts/ 135 KiB 6 modules modules by path ../assets/static/fonts/icons/ 898 bytes modules by path ../assets/static/fonts/icons/fontawesome/ 490 bytes 2 modules modules by path ../assets/static/fonts/icons/themify/ 408 bytes 5 modules modules by path ../assets/styles/ *.scss 2.38 MiB ../assets/styles/index.scss 1.69 KiB [built] [code generated] ../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!../../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[3].use[3]!../assets/styles/index.scss 2.38 MiB [built] [code generated] ERROR in The 'cwd' option must be a path to a directory webpack 5.52.1 compiled with 1 error in 16220 ms i 「wdm」: Failed to compile. Watchpack Error (initial scan): Error: ENOTDIR: not a directory, scandir 'C:\Users\user\screen\adminator\src\index.js'

package.jsonは下記のようになっています。
scriptsの部分を抜粋しました。

package.json "scripts": { "start": "webpack server --open", "dev": "webpack-dashboard -t 'Project' -- webpack server", "clean": "shx rm -rf ./dist", "build": "npm run clean && cross-env webpack", "preview": "cross-env webpack server", "lint:js": "eslint ./src ./webpack ./*.js -f table --ext .js --ext .jsx", "lint:scss": "stylelint ./src/**/*.scss --syntax scss", "lint": "npm run lint:js && npm run lint:scss", "browser": "open -a 'Google Chrome' ./dist/index.html", "born": "npm-run-all -p start browser" },
webpack.config.js ---------------------------------- const config = require('./webpack/config'); module.exports = config;
config.js ---------------------------------- // ------------------ // @Table of Contents // ------------------ /** * + @Loading Dependencies * + @Entry Point Setup * + @Path Resolving * + @Exporting Module */ // --------------------- // @Loading Dependencies // --------------------- const path = require('path'), manifest = require('./manifest'), devServer = require('./devServer'), rules = require('./rules'), plugins = require('./plugins'); // ------------------ // @Entry Point Setup // ------------------ const entry = [ path.join(manifest.paths.src, 'assets', 'scripts', manifest.entries.js), ]; // --------------- // @Path Resolving // --------------- const resolve = { extensions: ['.webpack-loader.js', '.web-loader.js', '.loader.js', '.js'], modules: [ path.join(__dirname, '../node_modules'), path.join(manifest.paths.src, ''), ], }; // ----------------- // @Exporting Module // ----------------- module.exports = { devtool: manifest.IS_PRODUCTION ? false : 'source-map', context: path.join(manifest.paths.src, manifest.entries.js), // watch: !manifest.IS_PRODUCTION, entry, mode: manifest.NODE_ENV, // output: { // path: manifest.paths.build, // publicPath: '', // filename: manifest.outputFiles.bundle, // }, module: { rules, }, resolve, plugins, devServer: { contentBase: path.join(__dirname, 'public'), open: true, watchContentBase: true, }, }; コード

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

今のところはファイルを削除し、npm再インストールでしか回避できていません。
index.jsをいじることでこのエラーが発生したかと思います。
ほかのファイルとの作用もあるかもしれませんが、一旦解決といたします。

投稿2021/09/24 00:32

skillUp

総合スコア25

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.46%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問