Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

missing script: scss when a styles.scss file is already here #19384

Closed
antoinecomp opened this issue Dec 12, 2017 · 2 comments
Closed

missing script: scss when a styles.scss file is already here #19384

antoinecomp opened this issue Dec 12, 2017 · 2 comments
Labels

Comments

@antoinecomp
Copy link

antoinecomp commented Dec 12, 2017

Hi there ! I am new to nodejs packet manager. I am following a Coursera MOOC on Bootstrap4 from the University of Hong Kong.

I'm opening this issue because:

  • npm is crashing.
  • npm is doing something I don't understand.

What's going wrong?

I wrote a styles.scss file to learn about scss.
After adding "scss": "node-sass -o css/ css/" to the package.json file, I tried to run npm run scss from my css floder after installing the node module to support the compilation of the Scss file to a CSS file. It gave me th following error :


mike@mike-thinks:~/Bootstrap4/conFusion/css$ npm run scss
npm ERR! Linux 4.10.0-42-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "scss"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2

npm ERR! missing script: scss
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/mike/Bootstrap4/conFusion/css/npm-debug.log

The npm-debug.log content is :

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'scss' ]
2 info using npm@3.5.2
3 info using node@v4.2.6
4 verbose stack Error: missing script: scss
4 verbose stack     at run (/usr/share/npm/lib/run-script.js:147:19)
4 verbose stack     at /usr/share/npm/lib/run-script.js:57:5
4 verbose stack     at /usr/share/npm/node_modules/read-package-json/read-json.js:345:5
4 verbose stack     at checkBinReferences_ (/usr/share/npm/node_modules/read-package-json/read-json.js:309:45)
4 verbose stack     at final (/usr/share/npm/node_modules/read-package-json/read-json.js:343:3)
4 verbose stack     at then (/usr/share/npm/node_modules/read-package-json/read-json.js:113:5)
4 verbose stack     at /usr/share/npm/node_modules/read-package-json/read-json.js:300:12
4 verbose stack     at /usr/share/npm/node_modules/graceful-fs/graceful-fs.js:76:16
4 verbose stack     at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
5 verbose cwd /home/mike/Bootstrap4/conFusion/css
6 error Linux 4.10.0-42-generic
7 error argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "scss"
8 error node v4.2.6
9 error npm  v3.5.2
10 error missing script: scss
11 error If you need help, you may report this error at:
11 error     <https://github.com/npm/npm/issues>
12 verbose exit [ 1, true ]

How can the CLI team reproduce the problem?

You can reproduce the problem by cloning my repository dedicated to Bootstrap 4 learning.

supporting information:

  • npm -v prints: 3.5.2
  • node -v prints: v4.2.6
  • npm config get registry prints: https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: Linux 16.04
@antoinecomp antoinecomp changed the title missing script: scss missing script: scss when a styles.scss file is already here Dec 12, 2017
@kenany
Copy link
Contributor

kenany commented Dec 12, 2017

Ensure that the "scss" script is listed under "scripts", not "devDependencies". See below:

{
  "name": "confusion",
  "version": "1.0.0",
  "description": "This is a website for Ristorante Con Fusion",
  "main": "index.html",
  "scripts": {
    "start": "npm run lite",
    "test": "echo \"Error: no test specified\" && exit 1",
    "lite": "lite-server",
    "scss": "node-sass -o css/ css/"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "lite-server": "^2.2.2",
    "node-sass": "^4.7.2"
  },
  "dependencies": {
    "bootstrap": "^4.0.0-alpha.6",
    "font-awesome": "^4.7.0"
  }
}

@kenany kenany added the support label Dec 12, 2017
@antoinecomp
Copy link
Author

Thank you that was the answer, sorry, I was a beginner at this time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants