Grunt build failing - angularjs

I'm trying to build my angularjs project but i keep getting this error. I have searched for a solution but could not find one. How can i fix this error?
Thanks.
Error message
"/usr/local/bin/grunt" "clean"
>> Local Npm module "grunt-aws" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
Loading "Gruntfile.js" tasks...ERROR
>> Error: Unable to read ".aws.json" file (Error code: ENOENT).
>> No "clean" targets found.
Warning: Task "clean" failed. Use --force to continue.
Aborted due to warnings.
Done.

I think you need to post-install your missing dependencies before your script launches on AWS.
Try adding in your package.json the following:
"scripts": { "postinstall": "npm install" }
Or simply run npm install grunt-aws grunt-contrib-connect ... before starting your app.

Related

Error: Cannot find module 'C:\...\node_modules\isexe\index.js'. Please verify that the package.json has a valid "main" entry

I am running npm run test:CI (jest-html-reporter) in Bamboo CI but this error occurred:
node:internal/modules/cjs/loader:361
throw err;
^
Error: Cannot find module 'C:\...\node_modules\isexe\index.js'. Please verify that the package.json has a valid "main" entry
The main in my package.json is set to 'dist/index.js'
What is this error and how can I resolve it?
Can you try to clean the cache:
npm cache clean
If it doesn't work try:
npm cache clean --force
Also, I cannot see your folder structure, but I think the route is: './dist/index.js', not 'dist/index.js'.

Next JS : Error: EPERM: operation not permitted, open

I am trying to build the next Js app production files to deploy it on cPanel, when I execute
npm run dev the app is working just fine but as I start to build a production file with the help of this video(https://youtu.be/1ykSXau838c) and executes npm run build it gives me an error in the terminal as given below:
PS C:\Users\hp\Desktop\reactJs-project\NextJs\test-app> npm run build
> test-app#0.1.0 build
> next build
info - Checking validity of types
info - Creating an optimized production build .node:events:368
throw er; // Unhandled 'error' event
^
Error: EPERM: operation not permitted, open 'C:\Users\hp\Desktop\reactJs-project\NextJs\test-app\.next\trace'
Emitted 'error' event on WriteStream instance at:
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4048,
code: 'EPERM',
syscall: 'open',
path: 'C:\\Users\\hp\\Desktop\\reactJs-project\\NextJs\\test-app\\.next\\trace'
}
so I just want to know is there any way to solve this problem?
Posting comment from Koronag as an answer (as it helped me with this error and seems the most likely cause)...
This error is commonly seen when running a build while the dev server is already running. (E.g. in my case, I had a local build running via npm run dev and was trying to commit/push code, which invoked a Git Hook that also runs npm run dev.)
For me, it works fine this answer drives me to the resolver.
I run 2 scripts in terminals:
once for development
another for the build process.
So after killing the development script it looks perfectly fine!
From next-sitemap repo README.md
"Having next-sitemap command & next-sitemap.js file may result in file opening instead of building sitemaps in windows machines.
As a solution to this, it is now possible to use a custom config file instead of next-sitemap.js. Just pass --config .js to build command."
Next-Sitemap README.md - Building Sitemaps
The above worked for me

Cannot find module gulp.js

I checked-out a solution from TFS and I have this error in my console when trying to clean & build a solution - > Error: Cannot find module 'C:..\node_modules\gulp\bin\gulp.js'.
Any idea why is not found?
I tried already to reinstall npm and gulp ( also globally ).
Try this:
cd /usr/lib/node_modules/gulp/node_modules/v8flags
sudo node fetch.js
And that's it. The last instruction will create the required file.

react-native i can not run iOS

** BUILD FAILED **
The following commands produced analyzer issues:
Analyze /Users/allen/WebstormProjects/untitled/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
Analyze /Users/allen/WebstormProjects/untitled/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
(2 commands with analyzer issues)
The following build commands failed:
PhaseScriptExecution Install\ Third\ Party /Users/allen/WebstormProjects/untitled/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/untitled.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/untitled.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
try this:
> rm -rf ~/.rncache
> rm -rf node_modules
> yarn install
> react-native run-ios
use yarn install replace npm install. I got the exact same error when using npm install, after try yarn install, it finally works for me.
my project dependencies:
"react": "16.0.0-alpha.12"
"react-native": "0.45.1"

Problems with grunt serve

I have project, but i can't run him. I use WebStorm IDE and after enter grunt serve I catch next errors:
grunt serve
Loading "connect.js" tasks...ERROR
>> SyntaxError: C:\Users\TT\Documents\ES\frontend\node_modules\grunt-contrib-connect\node_modules\connect\node_modules\type-is\node_modules\mime-types\node_modules\mime-db\db.json: Unexpect
ed end of input
Loading "cssmin.js" tasks...ERROR
>> Error: Cannot find module './source-map/source-map-generator'
Loading "jshint.js" tasks...ERROR
>> Error: Cannot find module 'jshint/src/cli'
Loading "uglify.js" tasks...ERROR
>> Error: Cannot find module 'pako/lib/zlib/messages'
Loading "cdnify.js" tasks...ERROR
>> SyntaxError: C:\Users\TT\Documents\ES\frontend\node_modules\grunt-google-cdn\node_modules\google-cdn\node_modules\cdnjs-cdn-data\external\cdnjs.json: Unexpected end of input
Loading "inline_angular_templates.js" tasks...ERROR
>> Error: Cannot find module 'domutils'
Running "serve" task
Warning: Task "connect:livereload" not found. Use --force to continue.
Aborted due to warnings.
Execution Time (2015-05-10 09:03:36 UTC)
loading tasks 18ms █████████████████████████████████████████████████████████████████████████████████████████████████████████ 56%
serve 11ms ████████████████████████████████████████████████████████████████ 34%
Total 32ms
Can you help me? How to fix it and what need install in order to this project earned?
I found a solution.
Here are the steps:
Remove nodejs and all npm's.
Install node
npm install
npm install -g bower
bower install
grunt serve
Success
um... run:
$ grunt -v
this will give you the missing (corrupted) node_modules. Sometimes things get corrupted or such.
I ran into this same problem with grunt-google-cdn and reinstalled it. with $ npm install grunt-google-cdn --save and everything went fine after that :)
reinstalling everything is generally not required.

Resources