简体   繁体   中英

npm start npm ERR! Missing script: "start"

Getting this error with "npm start." Similar questions have their problems solved by reconfiguring package.json, so I tried changing mine:

 "scripts": {
        "start": "node app.js"
      },

but still got the error. Could it be because I used webpack?

My package.json file:

{
    "name": "webapp",
    "version": "0.0.0",
    "description": "",
    "keywords": [],
    "scripts": {
        "start": "webpack-dev-server --mode production",
        "build": "webpack --mode production",
        "deploy": "gh-pages -d dist",
        "test": "cypress open"
    },
    "author": "",
    "license": "ISC",
    "devDependencies": {
        "@types/html-webpack-plugin": "^3.2.3",
        "apexcharts": "^3.19.2",
        "clean-webpack-plugin": "^3.0.0",
        "css-loader": "^3.5.3",
        "cypress": "^4.10.0",
        "eslint": "^7.1.0",
        "file-loader": "^6.0.0",
        "gh-pages": "^3.0.0",
        "html-loader": "^1.1.0",
        "html-webpack-plugin": "^4.3.0",
        "image-webpack-loader": "^6.0.0",
        "markup-inline-loader": "^0.2.3",
        "mini-css-extract-plugin": "^0.9.0",
        "node-sass": "^4.14.1",
        "prettier": "^2.0.5",
        "sass-loader": "^8.0.2",
        "ts-loader": "^7.0.5",
        "typescript": "^3.9.6",
        "webpack": "^4.43.0",
        "webpack-cdn-plugin": "^3.3.1",
        "webpack-cli": "^3.3.11",
        "webpack-dev-server": "^3.11.0"
    },
    "dependencies": {}
}

@skara9 You're right. The problem was I was not in the same directory as package.json.

so I navigated to the right directory and tried npm start again and got

> webapp@0.0.0 start
> webpack-dev-server --mode production

CLI for webpack must be installed.
  webpack-cli (https://github.com/webpack/webpack-cli)

We will use "npm" to install the CLI via "npm install -D webpack-cli".
Do you want to install 'webpack-cli' (yes/no): 

When I said yes,

npm ERR!   c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.5.5"' -I/Users/alisonqiu/.node-gyp/17.3.0/include/node -I/Users/alisonqiu/.node-gyp/17.3.0/src -I/Users/alisonqiu/.node-gyp/17.3.0/deps/openssl/config -I/Users/alisonqiu/.node-gyp/17.3.0/deps/openssl/openssl/include -I/Users/alisonqiu/.node-gyp/17.3.0/deps/uv/include -I/Users/alisonqiu/.node-gyp/17.3.0/deps/zlib -I/Users/alisonqiu/.node-gyp/17.3.0/deps/v8/include -I../src/libsass/include  -O3 -gdwarf-2 -flto -mmacosx-version-min=10.7 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/extend.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/extend.o ../src/libsass/src/extend.cpp
npm ERR!   c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.5.5"' -I/Users/alisonqiu/.node-gyp/17.3.0/include/node -I/Users/alisonqiu/.node-gyp/17.3.0/src -I/Users/alisonqiu/.node-gyp/17.3.0/deps/openssl/config -I/Users/alisonqiu/.node-gyp/17.3.0/deps/openssl/openssl/include -I/Users/alisonqiu/.node-gyp/17.3.0/deps/uv/include -I/Users/alisonqiu/.node-gyp/17.3.0/deps/zlib -I/Users/alisonqiu/.node-gyp/17.3.0/deps/v8/include -I../src/libsass/include  -O3 -gdwarf-2 -flto -mmacosx-version-min=10.7 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/file.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/file.o ../src/libsass/src/file.cpp
npm ERR!   c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.5.5"' -I/Users/alisonqiu/.node-gyp/17.3.0/include/node -I/Users/alisonqiu/.node-gyp/17.3.0/src -I/Users/alisonqiu/.node-gyp/17.3.0/deps/openssl/config -I/Users/alisonqiu/.node-gyp/17.3.0/deps/openssl/openssl/include -I/Users/alisonqiu/.node-gyp/17.3.0/deps/uv/include -I/Users/alisonqiu/.node-gyp/17.3.0/deps/zlib -I/Users/alisonqiu/.node-gyp/17.3.0/deps/v8/include -I../src/libsass/include  -O3 -gdwarf-2 -flto -mmacosx-version-min=10.7 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/functions.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/functions.o ../src/libsass/src/functions.cpp
npm ERR!   c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.5.5"' -I/Users/alisonqiu/.node-gyp/17.3.0/include/node -I/Users/alisonqiu/.node-gyp/17.3.0/src -I/Users/alisonqiu/.node-gyp/17.3.0/deps/openssl/config -I/Users/alisonqiu/.node-gyp/17.3.0/deps/openssl/openssl/include -I/Users/alisonqiu/.node-gyp/17.3.0/deps/uv/include -I/Users/alisonqiu/.node-gyp/17.3.0/deps/zlib -I/Users/alisonqiu/.node-gyp/17.3.0/deps/v8/include -I../src/libsass/include  -O3 -gdwarf-2 -flto -mmacosx-version-min=10.7 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/inspect.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/inspect.o ../src/libsass/src/inspect.cpp

What could be the problem this time? Thank you so much!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM