Yarn installation, Module build failed: Error: Couldn't find preset "es2015" - npm

I need to use react-select: https://github.com/JedWatson/react-select
For that I needed to first install yarn on Ubuntu 14.04. After the installation, and yarn add react-select I can not build my project anymore with webpack since it is giving me the error:
ERROR in ./views/index.js
Module build failed: Error: Couldn't find preset "es2015" relative to directory "/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome"
at /home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
at Array.map ()
at OptionManager.resolvePresets (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
at OptionManager.mergePresets (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
at OptionManager.mergeOptions (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
at OptionManager.init (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at File.initOptions (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/index.js:212:65)
at new File (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/file/index.js:135:24)
at Pipeline.transform (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
at transpile (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-loader/lib/index.js:50:20)
at /home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-loader/lib/fs-cache.js:118:18
at ReadFileContext.callback (/home/nikita/Desktop/kipnis_prototype/client_side_BrainImmuneConnectome/brain-immune-connectome/node_modules/babel-loader/lib/fs-cache.js:31:21)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:437:13)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! brainimmuneconnectome#0.0.0 webpack: webpack
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the brainimmuneconnectome#0.0.0 webpack 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! /home/nikita/.npm/_logs/2018-06-07T04_11_30_458Z-debug.log
I have presents installed in .babelrc file:
{
"presets": ["es2015", "react", "stage-1"]
}
So, the solutions that I found here:
Error: Couldn't find preset "es2015" relative to directory
are not working. What is going wrong here? How could it be fixed?

I found the solution here:
https://github.com/babel/gulp-babel/issues/93
Doing the following:
npm i babel-preset-es2015
npm i babel-preset-stage-2
Solved the issue.

Related

Unable to "npm install"

Please could I ask for help with the following:
I have cloned the Electron starter app like so:
git clone https://github.com/electron/electron-quick-start
And have it running.
I am working from the terminal window is VSCode.
I am using node version 6.13.4
Can type "npm start" and all is good, app runs fine.
Now, I want to use a certain package for working with zip files, so I try the following:
npm install decompress-zip
The result is ultimately an error, here's the output:
PS C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip> npm install decompress-zip
> electron#16.0.5 postinstall C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\electron
> node install.js
RequestError: self signed certificate in certificate chain
at ClientRequest.<anonymous> (C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\got\source\request-as-event-emitter.js:178:14)
at Object.onceWrapper (events.js:428:26)
at ClientRequest.emit (events.js:333:22)
at ClientRequest.origin.emit (C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\#szmarczak\http-timer\source\index.js:37:11)
at TLSSocket.socketErrorListener (_http_client.js:426:9)
at TLSSocket.emit (events.js:321:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
npm WARN rollback Rolling back debug#2.6.9 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\extract-zip\node_modules'npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron#16.0.5 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#16.0.5 postinstall 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! C:\Users\105043131\AppData\Roaming\npm-cache\_logs\2022-01-05T11_15_47_499Z-debug.log
Now the build is broken. If try again "npm start" then I get:
PS C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip> npm
start
electron-quick-start#1.0.0 start C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip
electron .
internal/modules/cjs/loader.js:984 throw err; ^
Error: Cannot find module 'C:\Work\Electron
Apps\electron-quick-start-added-fs-and-zip\node_modules\electron\cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:981:15)
at Function.Module._load (internal/modules/cjs/loader.js:863:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } npm ERR! code ELIFECYCLE npm
ERR! errno 1 npm ERR! electron-quick-start#1.0.0 start: electron .
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the
electron-quick-start#1.0.0 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!
C:\Users\105043131\AppData\Roaming\npm-cache_logs\2022-01-05T11_18_31_473Z-debug.log
Makes no difference now if I run "npm uninstall decompress-zip", I still get the same error when I try "npm start".
This line from the above caught my eye:
npm ERR! Failed at the electron#16.0.5
If I start completely over an try installing another package instead like so:
npm install yauzl
I get similar errors including the line:
npm ERR! Failed at the electron#16.0.5 postinstall script.
I currently have electron 8.1.1 installed
Could it be that these packages require electron 16?
Or is it something else?
If it is the former, would anyone know of a solution for unzipping a disk file using an older version of electron?
Thanks for any help.
the best way is to update Node.js. Uninstall old version then go to https://nodejs.org/en/download/ and download LTC version

Can't open localhost in vue js?

Recently I can't open any of my vue apps. I tried installing all dependencies with npm install and when I run npm run serve, I get following errors:
> vue-first-app#0.1.0 serve D:\Software Development\Front-end\1-Vue\14.Animations&Transitions\routingeg
> vue-cli-service serve
'Transitions\routingeg\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module 'D:\Software Development\Front-end\1-Vue\#vue\cli-service\bin\vue-cli-service.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-first-app#0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-first-app#0.1.0 serve 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! C:\Users\basirpayenda\AppData\Roaming\npm-cache\_logs\2021-02-26T12_03_43_305Z-debug.log
This error isn't really helpful for me to understand what is wrong, I tried reinstalling vue and vue cli, but still I am getting this error in all my vue apps? Can anyone help? Thank You In Advance.
It seems to me the & in the directory name 14.Animations&Transitions is problematic.

ERROR Error: Using removed Babel 5 option:

I am working on Vue project. So far It was working for me.
After I install some packages, it doesn't work.
error is like :
ERROR Error: Using removed Babel 5 option: .modules - Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules
Error: Using removed Babel 5 option: .modules - Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules
at throwUnknownError (E:\booking_room\node_modules\#babel\core\lib\config\validation\options.js:121:11)
at Object.keys.forEach.key (E:\booking_room\node_modules\#babel\core\lib\config\validation\options.js:108:5)
at Array.forEach (<anonymous>)
at validateNested
(E:\booking_room\node_modules\#babel\core\lib\config\validation\options.js:84:21)
at validate
(E:\booking_room\node_modules\#babel\core\lib\config\validation\options.js:75:10)
at file
(E:\booking_room\node_modules\#babel\core\lib\config\config-chain.js:169:34)
at cachedFunction
(E:\booking_room\node_modules\#babel\core\lib\config\caching.js:62:27)
at cachedFunction.next (<anonymous>)
at evaluateSync
(E:\booking_room\node_modules\gensync\index.js:244:28)
at syn
(E:\booking_room\node_modules\gensync\index.js:84:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! booking_room#0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the booking_room#0.1.0 serve 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! C:\Users\ASSASSIN\AppData\Roaming\npm-cache\_logs\2020-05-20T13_19_18_381Z-debug.log
babel.config.js:
module.exports = {
presets: [
'#vue/cli-plugin-babel/preset'
],
modules: ['bootstrap-vue/nuxt'],
bootstrapVue: {
bootstrapCSS: false,
bootstrapVueCSS: false
}
}
I am not sure what is the problem. please any suggestions.
I found the solution.
Because I used modules that removed Babel 5.
So I replaced plugins instead of modules.
it works for me.

Unable to build my Vuejs application using npm run build

When I run npm run build in my Vuejs application I get the following error:
compiler.hooks.compilation.tap(
^
TypeError: Cannot read property 'compilation' of undefined
at OptimizeCssAssetsWebpackPlugin.apply (C:\Users\EFOSA\Desktop\my_project\client\node_modules\last-call-webpack-plugin\src\index.js:170:20)
at Compiler.apply (C:\Users\EFOSA\Desktop\my_project\client\node_modules\tapable\lib\Tapable.js:375:16)
at webpack (C:\Users\EFOSA\Desktop\my_project\client\node_modules\webpack\lib\webpack.js:33:19)
at err (C:\Users\EFOSA\Desktop\my_project\client\build\build.js:19:3)
at next (C:\Users\EFOSA\Desktop\my_project\client\node_modules\rimraf\rimraf.js:75:7)
at CB (C:\Users\EFOSA\Desktop\my_project\client\node_modules\rimraf\rimraf.js:111:9)
at C:\Users\EFOSA\Desktop\my_project\client\node_modules\rimraf\rimraf.js:137:14
at FSReqWrap.oncomplete (fs.js:154:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my_project#1.0.0 build: node build/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my_project#1.0.0 build 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! C:\Users\EFOSA\AppData\Roaming\npm-cache_logs\2019-07-02T07_51_40_908Z-debug.log
I'm running webpack 3.12.
Could someone please help me with this?
There is a problem with your configuration and/or plugin version. Check the optimize-css-assets-webpack-plugin documentation:
For webpack v3 or below please use
optimize-css-assets-webpack-plugin#3.2.0. The
optimize-css-assets-webpack-plugin#4.0.0 version and above supports
webpack v4.

Failed at the electron#1.8.2 postinstall script

I was trying to install electron into my project, but it is giving an error. I also tried to do this with unsafe-perm, but still giving the same error.
npm install electron --save-dev --save-exact
> electron#1.8.2 postinstall E:\PrgLang\Electron\crypto-app\node_modules\electron
> node install.js
Downloading electron-v1.8.2-win32-x64.zip
[============================================>] 100.0% of 55.21 MB (1.51 MB/s)
E:\PrgLang\Electron\crypto-app\node_modules\electron\install.js:47
throw err
^
Error: Could not parse checksum file at line 1:
at new ChecksumParseError (E:\PrgLang\Electron\crypto-app\node_modules\sumchecker\build.js:71:127)
at E:\PrgLang\Electron\crypto-app\node_modules\sumchecker\build.js:130:20
at Array.forEach (<anonymous>)
at E:\PrgLang\Electron\crypto-app\node_modules\sumchecker\build.js:125:38
at new Promise (<anonymous>)
at ChecksumValidator.parseChecksumFile (E:\PrgLang\Electron\crypto-app\node_modules\sumchecker\build.js:121:14)
at <anonymous>
npm WARN crypto-app#1.0.0 No description
npm WARN crypto-app#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron#1.8.2 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#1.8.2 postinstall 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! C:\Users\Harshit\AppData\Roaming\npm-cache\_logs\2018-02-11T03_33_52_399Z-debug.log
Can you please try(after removing node_modules)
sudo npm install electron --save-dev --save-exact --unsafe-perm=true --allow-root
I was running into the same error and this is what worked for me.
According to this GitHub issue it could potentially be solved with one of the following actions:
remove the node_modules folder and run npm install again
rename the SHASUM file in your user home directory's .electron folder
The postinstall script of Electron is downloading a binary from a non-npm domain (possibly github.com), for which the proxy may not be configured.