Npm run start not working, No configuration provided for main.scss

I’ve been working on a project for quite some time with sage 9.0.9 and it’s been working great. A couple of days ago I removed the node_modules folder by mistake and had to do a “npm install” again. It failed with the following error:

pm ERR! code ERESOLVE
npm ERR! RESOLVE unable to resolve dependency tree
nom ERR!
pm ERR! While resolving: sage@9.0.9
pm ERR! Found: webpack@3.10.0
nom ERR! node modules/webpack
nom ERR!
dev webpack@“~3.10.0” from the root project
nom ERR!
pm ERR! Could not resolve dependency:
nom ERR! peer webpack@“^1.13.2 ||
^2.7.0 || ^3.11.0 || ^4.4.0” from stylelint-webpack-plugin@0.10.5
nom ERR! node modules/stylelint-webpack-plugin
nom ERR!
dev stylelint-webpack-plugin@“^0.10.5” from the root project
nom ERR!
nom ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with
-force, or
–legacy-peer-deps
nom ERR! to accept an incorrect (and potentially broken) dependency resolution.
nom ERR!
nom ERR! See /Users/triphys/.pm/eresolve-report.txt for a full report.
pm ERR! A complete log of this run
can be found in:
nom ERR!
/Users/triphys/.npm/_logs/2022-03-21T21_30_35_507Z-debug-b.log

I tried doing an “npm install --legacy-peer-deps” and tried removing package.lock file, but only received error saying I had to log in to npm.

After trying “yarn” instead it seemed to work, still got the dependency errors but it “went through”. But when I try “yarn run start” I get the following error:

yarn run start
yarn run v1.22.17
$ webpack -hide-modules -watch -config resources/assets/build/webpack.config.js
Webpack is watching the files…
Error: No configuration provided for /Users/triphys/Sites/tam/wp-content/themes/tam/resources/assets/stvles/main.scss
at module.exports (/Users/triphys/Sites/tam/wp-content/themes/tam/node_modules/stylelint/lib/utils/configurationError.js:8:28)
at /Users/triphys/Sites/tam/wp-content/themes/tam/node_modules/stylelint/lib/getConfigForFile.js:46:15
at async Promise.all (index 20)
error Command failed with exit code 1.
info Visit https://varnpka.com/en/docs/cli/run for documentation about this command.

I now get the same error with “npm run start”. I’m clueless of what to do to get my project up and running again. I’m guessing that I’m missing a .stylelint.js file somewhere but I don’t know where to put it or what to put in it?

Thanks in advance

What version of node are you using?

Please don’t post screenshots of errors: Post the actual test. Images are not searchable or copy-pastable.

Okay, I fixed.
Did update yesterday, not sure which one I ran before but now.

node: v17.3.1
npm: 8.3.0

You may be using a node version that’s too high. The recommended node version for Sage 9 is node 8, and you’re using node 17. Because of that, it likely can’t find dependency versions that are compatible with your version of node and the versions specified in package.json. I’d try using node 8 and see if that resolves the problem. I’d recommend using nvm if you aren’t already.

Thank you, I tried that (with node 8) but I get the following issue when running “npm install”.

npm install
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "npm:": npm:sass@^1.49.0

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/triphys/.npm/_logs/2022-03-25T08_30_05_340Z-debug.log

I tried with node version 13.0.0 and npm install works.
But at the end when running “npm run start” I get the same following:

Webpack is watching the files…

Error: No configuration provided for /Users/triphys/Sites/tam/wp-content/themes/tam/resources/assets/styles/common/_global.scss
    at module.exports (/Users/triphys/Sites/tam/wp-content/themes/tam/node_modules/stylelint/lib/utils/configurationError.js:8:28)
    at /Users/triphys/Sites/tam/wp-content/themes/tam/node_modules/stylelint/lib/getConfigForFile.js:46:15
    at async Promise.all (index 2)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sage@9.0.9 start: `webpack --hide-modules --watch --config resources/assets/build/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sage@9.0.9 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/triphys/.npm/_logs/2022-03-25T08_39_12_115Z-debug.log

Echoing what @alwaysblank already mentioned: Did you try Node 8 or not?

(Node 13 is not Node 8)

edit: whoops, saw your note

Sorry for being unclear, but if you read two messages back I tried with node 8 but got an error message regarding Unsupported URL for npm:sass

1 Like

Can you post the contents of your package.json?

Sure thing, here it is:

{
  "name": "sage",
  "version": "9.0.9",
  "author": "Roots <team@roots.io>",
  "homepage": "https://roots.io/sage/",
  "private": true,
  "repository": {
    "type": "git",
    "url": "git://github.com/roots/sage.git"
  },
  "bugs": {
    "url": "https://github.com/roots/sage/issues"
  },
  "licenses": [
    {
      "type": "MIT",
      "url": "http://opensource.org/licenses/MIT"
    }
  ],
  "browserslist": [
    "last 2 versions",
    "android 4",
    "opera 12"
  ],
  "scripts": {
    "build": "webpack --progress --config resources/assets/build/webpack.config.js",
    "build:production": "webpack --env.production --progress --config resources/assets/build/webpack.config.js",
    "build:profile": "webpack --progress --profile --json --config resources/assets/build/webpack.config.js",
    "start": "webpack --hide-modules --watch --config resources/assets/build/webpack.config.js",
    "rmdist": "rimraf dist",
    "lint": "npm run -s lint:scripts && npm run -s lint:styles",
    "lint:scripts": "eslint resources/assets/scripts resources/assets/build",
    "lint:styles": "stylelint \"resources/assets/styles/**/*.{css,sass,scss,sss,less}\"",
    "test": "npm run -s lint"
  },
  "engines": {
    "node": ">= 8.0.0"
  },
  "devDependencies": {
    "autoprefixer": "~8.2.0",
    "browser-sync": "~2.24.7",
    "browsersync-webpack-plugin": "^0.6.0",
    "bs-html-injector": "~3.0",
    "buble-loader": "^0.4.1",
    "cache-loader": "~1.2.5",
    "clean-webpack-plugin": "^0.1.18",
    "copy-globs-webpack-plugin": "^0.2.0",
    "css-loader": "^0.28.9",
    "cssnano": "~4.0.5",
    "eslint": "~4.19.1",
    "eslint-loader": "~1.9",
    "eslint-plugin-import": "~2.14.0",
    "eslint-plugin-react": "^7.29.4",
    "extract-text-webpack-plugin": "~3.0.2",
    "file-loader": "^1.1.6",
    "friendly-errors-webpack-plugin": "^1.6.1",
    "imagemin-mozjpeg": "~7.0.0",
    "imagemin-webpack-plugin": "~2.2.0",
    "import-glob": "~1.5",
    "node-sass": "npm:sass@^1.49.0",
    "postcss-loader": "~2.1.0",
    "postcss-safe-parser": "~3.0",
    "resolve-url-loader": "~2.3.1",
    "rimraf": "~2.6",
    "sass-loader": "~6.0",
    "style-loader": "^0.22.1",
    "stylelint": "^8.4.0",
    "stylelint-config-standard": "~18.2.0",
    "stylelint-webpack-plugin": "^0.10.5",
    "uglifyjs-webpack-plugin": "^1.3.0",
    "url-loader": "^0.6.2",
    "webpack": "~3.10.0",
    "webpack-assets-manifest": "^1.0.0",
    "webpack-dev-middleware": "~2.0.4",
    "webpack-hot-middleware": "~2.22.3",
    "webpack-merge": "~4.1.4",
    "yargs": "~11.0.0"
  },
  "dependencies": {
    "aos": "^2.3.4",
    "bootstrap": "v4.3.1",
    "gsap": "^3.3.0",
    "headroom.js": "^0.11.0",
    "jquery": "^3.3.1",
    "js-cookie": "^2.2.1",
    "parallax-js": "^3.1.0",
    "popper.js": "^1.14.7",
    "smooth-scroll": "^16.1.3",
    "tiny-slider": "^2.9.4"
  }
}

Thank you! Is there any way you could make a public repo with the repeatable error?

Of course, here it is, thank you!

"node-sass": "npm:sass@^1.49.0",

is likely the source of this error:

npm ERR! Unsupported URL Type "npm:": npm:sass@^1.49.0

Is there a reason you’re specifying that dependency in that way? I don’t think that’s standard.

Not sure to be honest. I think there was some mismatch with the default sass way back, but not sure. Do you know what should be the default for this version?

Okay, so that got me a bit further…
When running npm install now everything seems fine until the end when I get the following error:

npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none was installed.

npm ERR! path /Users/triphys/Sites/tam/wp-content/themes/tam/node_modules/.staging/imagemin-webpack-plugin-db9718aa/dist
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/Users/triphys/Sites/tam/wp-content/themes/tam/node_modules/.staging/imagemin-webpack-plugin-db9718aa/dist'
npm ERR!  { Error: EACCES: permission denied, mkdir '/Users/triphys/Sites/tam/wp-content/themes/tam/node_modules/.staging/imagemin-webpack-plugin-db9718aa/dist'
npm ERR!   cause:
npm ERR!    { Error: EACCES: permission denied, mkdir '/Users/triphys/Sites/tam/wp-content/themes/tam/node_modules/.staging/imagemin-webpack-plugin-db9718aa/dist'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'mkdir',
npm ERR!      path: '/Users/triphys/Sites/tam/wp-content/themes/tam/node_modules/.staging/imagemin-webpack-plugin-db9718aa/dist' },
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/Users/triphys/Sites/tam/wp-content/themes/tam/node_modules/.staging/imagemin-webpack-plugin-db9718aa/dist',
npm ERR!   parent: 'sage' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/triphys/.npm/_logs/2022-03-27T13_47_02_100Z-debug.log

I’m not sure what to do since that whole folder has the same user rights as everything else ($user : staff).

After that when running “npm run start” I get

npm run start

> sage@9.0.9 start /Users/triphys/Sites/tam/wp-content/themes/tam
> webpack --hide-modules --watch --config resources/assets/build/webpack.config.js

sh: webpack: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! sage@9.0.9 start: `webpack --hide-modules --watch --config resources/assets/build/webpack.config.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the sage@9.0.9 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/triphys/.npm/_logs/2022-03-27T13_47_08_524Z-debug.log

Not sure running this with sudo would be the best solution no?

Nope, yolo adding sudo before commands is how you just get into more trouble :sweat_smile:

There’s some helpful error messages there that should be able to point you in the right direction at least

I’m sorry, I’ve been at it for one full day now and I still can’t get it to run.
Reinstalled my dev environment, tried copying another theme which I know works but somehow only get the same error message.

Seems like webpack is the issue but can’t get it to run

I’d love to upgrade to Sage 10 but I have a client breathing down my neck, and I don’t have the time.