0

I followed along to a video and rechecked my code to ensure I didn't have any spelling errors. But for some reason, I have an error after I type in npm start in terminal.

kayladwilliams$ npm start > sassbootstrap@1.0.0 start /Users/kayladwilliams/Desktop/Accessibility_Website/sassbootstrap > parcel ./src/index.html Server running at localhost:1234 /Users/kayladwilliams/Desktop/Accessibility_Website/sassbootstrap/src/scss/style.css:undefined:undefined: ENOENT: no such file or directory, open '/Users/kayladwilliams/Desktop/Accessibility_Website/sassbootstrap/src/scss/style.css' Error: ENOENT: no such file or directory, open '/Users/kayladwilliams/Desktop/Accessibility_Website/sassbootstrap/src/scss/style.css' –

I looked into bootstrap website to see if anything is different from the website. I double checked my directory as well, along with a few other imports just don't recall which ones I found online, i have tried

1.@import "node_modules/bootstrap/scss/bootstrap";
2.@import "/bootstrap/scss/bootstrap";
3. npm install via terminal.

Christian
  • 4,902
  • 4
  • 24
  • 42
kaylawi
  • 1
  • 1

1 Answers1

0

Maybe you have messed up something in here or the required style.css is not available in the expected location, which is, according to this bootstrap tutorial defined in the package.json file, created initially by running npm init.

Then run npm i bootstrap to install bootstrap. Then import bootstrap using @import 'bootstrap';.

Then run npm install and npm start. This should install bootstrap as node module and you should ne able to use bootstrap.

Maybe you need to Install a different package like bootstrap-scss or bootstrap-sass though.

Bootstraps package.json contains some additional metadata under the following keys:

  • sass - path to Bootstrap’s main Sass source file
  • style - path to Bootstrap’s non-minified CSS that’s been precompiled using the default settings (no customization)
Christian
  • 4,902
  • 4
  • 24
  • 42
  • Just tried this, still having the same error. I assume I was supposed to do @import 'bootstrap'; in the style.scss file. I also attempted import 'bootstrap-scss'; and import 'bootstrap-sass'; in the style.scss file.Any other suggestions? Not sure if this is a common problem.Thank you so much for your help! – kaylawi Aug 20 '19 at 02:00
  • Corrected the @import above. Can you post the complete output here please. Have you updated node recently. npm rebuild might help. See https://stackoverflow.com/questions/45251645/error-enoent-no-such-file-or-directory-scandir – Christian Aug 20 '19 at 07:53
  • I did do the @import above, for some odd reason posting the previous comment, I couldn't submit unless I took the @ symbol out of the message.I have installed the npm recently so I assume its the most up to date version. I can attach a pic of what my terminal is saying – kaylawi Aug 20 '19 at 12:26
  • Kaylas-MacBook-Pro:sassbootstrap kayladwilliams$ npm i bootstrap npm WARN bootstrap@4.3.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself. npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself. npm WARN sassbootstrap@1.0.0 No description npm WARN sassbootstrap@1.0.0 No repository field. + bootstrap@4.3.1 updated 1 package and audited 10384 packages in 3.453s found 0 vulnerabilities – kaylawi Aug 20 '19 at 12:29
  • Kaylas-MacBook-Pro:sassbootstrap kayladwilliams$ npm install npm WARN bootstrap@4.3.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself. npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself. npm WARN sassbootstrap@1.0.0 No description npm WARN sassbootstrap@1.0.0 No repository field. audited 10384 packages in 3.263s found 0 vulnerabilities – kaylawi Aug 20 '19 at 12:30
  • Kaylas-MacBook-Pro:sassbootstrap kayladwilliams$ npm start > sassbootstrap@1.0.0 start /Users/kayladwilliams/Desktop/Accessibility_Website/sassbootstrap > parcel ./src/index.html Server running at http://localhost:1234 /Users/kayladwilliams/Desktop/Accessibility_Website/sassbootstrap/src/scss/style.css:undefined:undefined: ENOENT: no such file or directory, open '/Users/kayladwilliams/Desktop/Accessibility_Website/sassbootstrap/src/scss/style.css' Error: ENOENT: no such file or directory, open '/Users/kayladwilliams/Desktop/Accessibility_Website/sassbootstrap/src/scss/style.css' – kaylawi Aug 20 '19 at 12:30
  • Hopefully thats helpful since I couldn't paste the screenshot of my image – kaylawi Aug 20 '19 at 12:30
  • Does the file sassbootstrap/src/scss/style.css exist? – Christian Aug 20 '19 at 12:49
  • Yes, I created that file via Visual Studios. It's in the right directory. – kaylawi Aug 20 '19 at 17:15
  • I would show you my directory if pasting an image was allowed via comments. – kaylawi Aug 20 '19 at 17:18
  • I literally followed along to a video on Linkedln would it help if I sent that link? – kaylawi Aug 20 '19 at 17:18
  • I have updated my answer. Added a tutorial Link and an info about npm init, which could be the solution here. – Christian Aug 20 '19 at 20:19
  • Thanks! I will look into it. Appreciate it! – kaylawi Aug 21 '19 at 00:49