my serverless.js is missing from node_modules - aws-lambda

all. I'm new to nextJS deployment and the serverless.
In my NextJS project, I've installed serverless with the command "npm -g install serverless#2.72.2".
However, after I command with "sls", the error showed up as in the snip.
There is no folder #sls-next created in the node_moduels directory.
I've tried to manually create the file, but have no idea about the content in it.
How can I fix this?
❯ sls
error:
Error: No serverless.js file found in ./node_modules/#sls-next/serverless-component
at getAllComponents (/Users/icekubice/.nvm/versions/node/v17.1.0/lib/node_modules/serverless/node_modules/#serverless/template/utils.js:168:17)
at async Template.default (/Users/icekubice/.nvm/versions/node/v17.1.0/lib/node_modules/serverless/node_modules/#serverless/template/serverless.js:47:27)
at async Object.runComponents (/Users/icekubice/.nvm/versions/node/v17.1.0/lib/node_modules/serverless/node_modules/#serverless/cli/src/index.js:222:17)
0s › Template › Error: No serverless.js file found in ./node_modules/#sls-next/serverless-component
❯ sls -v
Framework Core: 2.72.2
Plugin: 5.5.4
SDK: 4.3.2
Components: 3.18.2

Related

How to install Laravel Vite?

The Laravel Vite Doc sais to run:
npx apply laravel:vite --ignore-existing
inside your project root to install vite in your laravel project.
When I try to do that in a freshly installed laravel project it shows this:
zsh:1: command not found: laravel:vite
What am I doing wrong?
Using Macos Big Sur with PhpStorm.
That command no longer applies to newly created projects (as of laravel-vite 0.1.27, released a few days ago), and it now results in a different error:
$ npx apply laravel:vite --ignore-existing
[ info ] Applying preset laravel:vite.
[ error ] The preset could not be evaluated.
evalmachine.<anonymous>:13
var preset_default = definePreset({
^
ReferenceError: definePreset is not defined
at evalmachine.<anonymous>:13:22
at Script.runInContext (node:vm:139:12)
at Object.runInContext (node:vm:289:6)
at ModuleImporter.evaluateConfiguration (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/Importer/ModuleImporter.js:68:26)
at ModuleImporter.import (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/Importer/ModuleImporter.js:17:27)
at PresetApplier.run (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/Applier/PresetApplier.js:22:87)
at async CommandLineInterface.apply (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/IO/CommandLineInterface.js:57:16)
at async CommandLineInterface.run (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/IO/CommandLineInterface.js:54:16)
However, the command shown in the laravel-presets/vite repository (the source repo for the laravel:vite preset) worked for me -- i.e., it augmented the Laravel project with Vite:
# Run this command from root of Laravel project
npx #preset/cli apply --debug laravel:vite
#preset/cli currently suppresses all output (including errors), so the --debug flag above is important. Since the verbose log is difficult to follow, I recommend redirecting the output to a file, and searching it for the word exception.
Tips
To ensure the preset succeeds, you must have php#8.0 (e.g., from Homebrew) and composer installed and available from the command line. Add the paths to those binaries to your PATH environment variable.
The Vite server must be started separately from the PHP server. Run npm run dev in one terminal; and php artisan serve from another.
Vite is now the default frontend asset bundler in laravel which replaces webpack. No additional installations are needed for new projects.
https://laravel-news.com/vite-is-the-default-frontend-asset-bundler-for-laravel-applications

Failed at the # production script. Error running npm run production

I am facing issue while using the following command
npm run production
after execute following command i see following error
ERROR Failed to compile with 5 errors
error in ./resources/assets/sass/app.scss
Module build failed: ModuleBuildError: Module build failed: TypeError: Cannot read property 'map' of undefined
at preparePluginsArray (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo\config.js:64:20)
at module.exports (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo\config.js:32:28)
at new module.exports (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo.js:21:19)
at E:\wamp\www\smm.yasmalik.com\node_modules\postcss-svgo\dist\index.js:95:16
at Object.creator [as postcssSvgo] (E:\wamp\www\smm.yasmalik.com\node_modules\postcss-svgo\node_modules\postcss\lib\postcss.js:150:35)
at E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\dist\index.js:295:40
at Array.forEach (<anonymous>)
at E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\dist\index.js:282:29
at creator (E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\node_modules\postcss\lib\postcss.js:150:35)
at processCss (E:\wamp\www\smm.yasmalik.com\node_modules\css-loader\lib\processCss.js:199:16)
It was issue with my node_modules folder. there were some extra useless packages so simply i just deleted node_modules and install it again with following commands
Step 1
Delete node_modules manually
Step 2
Install the node_modules folder again:
npm i
Step 3
Update existing packages
npm update
That's it!
Probably you have some conflicts with versions of some npm packages.
Try to reinstall npm:
rm -rf node_modules
npm install

React and Vue cli returns bash: command not found

After successfully installing vue-cli, I can't run vue init webpack my-project command. It returns bash: vue: command not found.
And I tried react-cli, using create-react-app project-name and still returns bash: create-react-app: command not found
I already checked it using npm list -g --depth=0 and it was installed in
C:\Users\userlocal\AppData\Roaming\npm
+-- create-react-app#1.5.2
`-- vue-cli#2.9.3
My PC is running on Windows7/Ultimate, and I am using node v8.9.4, and npm 5.8.0
Am I missing something here?

nativescript 'tns run android' throws ClassNotFoundException

I did a fresh clone of the nativescript grocery git repo, and checked out the angualr-start branch, did 'platform add android', and then 'tns run android' (which my android device connected)
The app came up and displayed this error: pastebin.com/1YbThGkZ
perhaps the most significant part of the error being this:
java.lang.ClassNotFoundException: Didn't find class "com.tns.FragmentClass" on path: DexPathList[[zip file "/data/app/org.nativescript.groceries-1/base.apk"],nativeLibraryDirectories=[/data/app/org.nativescript.groceries-1/lib/arm, /data/app/org.nativescript.groceries-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /systementer code here/lib]]
Solution: upgrade to native script (and tns-core-modules) v2.1
upgrade to native script (and tns-core-modules) v2.1
sudo npm install nativescript -g --unsafe-perm
tns plugin remove tns-core-modules
tns plugin add tns-core modules

Ionic Add Platform EACCES Error

Whenever I use ionic platform add [platformname] It gives me this error
Error: spawn EACCES
at exports._errnoException (util.js:746:11)
at ChildProcess.spawn (child_process.js:1155:11)
at Object.exports.spawn (child_process.js:988:9)
at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-
lib/src/cordova/superspawn.js:100:31)
at runScriptViaChildProcessSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-
lib/src/hooks/HooksRunner.js:188:23)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-
lib/src/hooks/HooksRunner.js:131:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova- lib/src/hooks/HooksRunner.js:114:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
It seems that the unpacked project has incorrect permissions. This answer suggested to change the permissions of hooks/after_prepare/010_add_platform_class.js to 755. But the solution from the Ioinc forum showed another easy way to solve this -- just run
ionic hooks add
after you create the project and change to your project directory. Then run:
ionic platform add ios
will success without errors.
I was getting a bunch of errors when i emulate the project (iOS). After 1 day. I found with my boss that if you apply "chmod -Rv 755 inside the ionic proyect folder, it's going to work like a charm!.
Steps:
Install node.js, cordova, ionic, iOS-sim
ionic start "project name" "template"
cd "project path"
chmod -Rv 755 * (change permissions inside the project folder scope)
ionic platform add iOS (in this case)
ionic build iOS
ionic emulate iOS
And it will work.
Hope if this helps

Resources