1
votes

I am trying to convert my jsx code to js using babel.

babel --presets es2015,react --minified finan.js -o ./compiled/compiled.js

Error: Cannot find module 'js-tokens' at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (C:\Users\Saurav\Desktop\newcode dev\untitled4\node_modules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-function-name\node_modules\babel-hel per-function-name\node_modules\babel-traverse\node_modules\babel-code-frame\lib\index.js:50:41) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17)

1

1 Answers

2
votes

Recently i faced the same error . Just use :

npm update

or delete babel-preset-es2015 from node_modules folder and reinstall it using

npm install