Failed to create node.js Express with Sass - node.js

I'm trying to build my first project of node.js Express server.
I'm using WebStorm IDE witch give me options to select a CSS engine. I try to select Sass and while the initializing the project I'm getting the following error:
This is only happening when I pick Sass. On every other option (plain CSS, Stylus, Less, Compass) it work's fine.
How can I fix this issue and use Sass (or SCSS) in my project?
My versions:
WebStorm: 2017.1.2
npm 5.2.0
node 8.1.4
express 4.15.0
Thank in advance.

Do you have sass installed? Because it seems like you need to run
npm install node-sass
for it to be able to work

I've opened an issue on git and they helped me there..
I needed to update my node-sass package to the latest one (4.5.3).
Thanks all!

Related

NPM not installing node module

I have an angular project that comes with a package.json file and all the dependencies listed within, but each time I run "npm install", in the terminal, the packages appear to be downloading properly and a node module folder is created in my root folder, but at a certain stage the installation stops without an error message and the generated node module folder disappear from my project. please what do I do?
I can't reproduce your situation, somehow this may not fitable for you.
But I suggest re-install node.js to make sure npm install work correctly.
This link will help to find what version of node.js for you, based on you angular version.
Compatibility list for Angular/Angular-CLI and Node.js
Also, It would be good to manage node.js via NVM(Node Version Manager).

Node JS 6.9 and angular CLI version compatibility

I have a restriction of using node JS version 6.9.1. I am getting many problems, while using angular cli quick start steps.
after ng serve, browser page will be white, no error in console.
npm start works, but if i change some style/file browser do not not refresh.
if i make any style change, webpack compiled successfully message comes but webserver fails to load page.
When I follow the quick start steps with latest nodejs it works like a charm. Can any one help me in telling, what are the versions (npm, angular-cli), I should use to run it ?
Like
Each Angular/Cli version has limited its compatibility of node versions below a specified release. If you have to use a specific version of node then your best bet would be to find a previous version of the Angular/Cli that will play nicely.
Here you can find all the versions and from there, pick one a little further back in the list and then do a search in google for "Angular/cli version x.x.x node compatibility" to see if there are any known issues.
Once you pick a version that looks good, run
npm install -g #angular/cli#<your version number>.
Once the install is complete run ng help and you'll get feedback right away if the version is still incompatible and you can try a different version.
Just make sure you get rid of the installs you aren't using with npm uninstall -g #angular/cli#<your version number>
for see if angular-cli is compatibility whit your node version installed you can see https://www.npmjs.com/package/#angular/cli/v/6.0.8?activeTab=versions, for example, I have installed node 6.11.2 and I have to use: npm install -g #angular/cli#6.0.0

Creating angular app in preferred version

I'm new to angular.
I'm creating an angular app using
ng new <app name>
but here I don't know how to specify the angular version and I don`t know how to check the angular version of the created app.
Can anyone help me in finding a solution for this.
You can find the angular version in your package.json file:
You can also change the version of all or of specific packages here, and then rerun npm install to install your specified version.
In package.json of your project you will find the current angular version you are using it in your project.
Also you can go through below link for knowing much in details
https://angular.io/guide/quickstart

React Native starter project bundling fails with Unexpected Token error

I'm trying to create my first React Native app for Android using the instructions on https://facebook.github.io/react-native/docs/getting-started.html. After setting up the dependencies and connecting my Android device, I ran
react-native init app
cd app
react-native run-android
This starts the React Packager, which fails to bundle with this error:
error: bundling failed: "TransformError: /Users/luky/dev/app/index.android.js: Unexpected token ) (While processing preset: \"/Users/luky/dev/app/node_modules/babel-preset-react-native/index.js\")"
I am using:
OSX El Capitan 10.11.6.
node version 6.9.2
react-native version 0.47.1.
I pushed my generated project, including node_modules, to Github in case it helps: https://github.com/luky1971/react-native-app
Does anyone know why I might be getting an Unexpected token error? Any help would be greatly appreciated!
I got the same thing, it looks like the latest version of the babel preset for react native has some bugs (version 3.0.0). I went into my package.json and replaced the latest version with this:
"babel-preset-react-native": "2.1.0".
then I deleted the node_modules directory and ran npm install and it worked.
Install babel-preset-react-native#2.1.0 and run the project.
In the current project, do this...
yarn remove babel-preset-react-native
yarn add babel-preset-react-native#2.1.0
This worked for me, I hope it will for you too.
You can find more information about the error here https://github.com/facebook/react-native/issues/15513#issuecomment-322824346
Try deleting the .babelrc file in the root directory. Or rename it. Then re-run the "react-native run-android" command. This worked for me. Good luck.
Looking for JS files in
/Users/admin/Desktop/CoinMarketCap
React packager ready.
Loading dependency graph, done.
Bundling `index.ios.js` [development, non-minified, hmr disabled] 0.0% (0/1), failed.
error: bundling failed: "TransformError: /Users/admin/Desktop/CoinMarketCap/index.ios.js: Unexpected token ) (While processing preset: \"/Users/admin/Desktop/CoinMarketCap/node_modules/babel-preset-react-native/index.js\")"
iMac-D001:CoinMarketCap admin$ react-native --v
react-native-cli: 2.0.1
react-native: 0.47.1
Fixed it for me:
https://github.com/facebook/react-native/issues/15545
iMac-D001:CoinMarketCap admin$ npm uninstall babel-preset-react-native
iMac-D001:CoinMarketCap admin$ npm install babel-preset-react-native#2.1.0
I cloned your project. It is working fine. You can delete node_modules folder, then npm_install. It will work fine.
Try to set a new project, choosing the version of react-native as below:
react-native init --version="0.55.0" MyNewApp
Go to the new project directory.
CD project_name
Open the app in android studio. Open the AVD manager emulator and choose the virtual device. Then execute this command back there on the prompt:
react-native run-android
This worked for me. Hope it can help you too.
It could also be because of a dependency that you're using and needs to be put in the preset of your babel.config.js
e.g. I ws using expo, then ejected. And one of the dependency was react-native-paper for which I had to change the babel.config.js file to get it working.

FAIL Inject RemoteDev monitor into React Native debugger

I am working on a React Native app and suddenly see this :
FAIL Inject RemoteDev monitor into React Native debugger, the file 'react-native\local-cli\server\util\debugger.html' not found.
when i run npm install.
It used to be ok before. I checked the folder AppData\Roaming\npm\node_modules\react-native\local-cli\server\util and the debugger.html file is there.
Here is my package.json script:
"postinstall": "remotedev-debugger"
How can I fix this?
I got this error today after updating to the latest React Native version.
I think you need to update RemoteDev package.
For me, this involved replacing remote-redux-devtools-on-debugger with the latest remotedev-rn-debugger (https://github.com/jhen0409/remotedev-rn-debugger) as the package name had changed.
Upgrade the remotedev-rn-debugger package.
If you use NPM:
npm i remotedev-rn-debugger#latest --save-dev
If you use Yarn:
yarn add remotedev-rn-debugger#latest --dev

Resources