GithubHelp home page GithubHelp logo

Comments (16)

jayair avatar jayair commented on July 29, 2024

It seems like a weird issue with a dependency. Can you try upgrading the version of serverless-bundle in your package.json to the latest? https://github.com/AnomalyInnovations/serverless-bundle/releases/tag/v4.3.0

Let me know if that works and we'll upgrade the repo with it.

from serverless-nodejs-starter.

bedamatta05 avatar bedamatta05 commented on July 29, 2024

Again its showing this error, seems like its not supporting the latest version of node and npm.

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=8 <=14' },
npm WARN EBADENGINE current: { node: 'v15.5.0', npm: '7.6.2' }
npm WARN EBADENGINE }
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"darwin"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: darwin
npm ERR! notsup Valid Arch: undefined
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64

from serverless-nodejs-starter.

jayair avatar jayair commented on July 29, 2024

This seems like a different package this time. Can you post the complete log?

from serverless-nodejs-starter.

bedamatta05 avatar bedamatta05 commented on July 29, 2024

Complete log :

0 verbose cli [
0 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli   'C:\\Users\\saisw\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli   'install'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing config:load:defaults Completed in 2ms
4 timing config:load:file:C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 4ms
5 timing config:load:builtin Completed in 5ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:C:\Users\saisw\notes-api\.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:C:\Users\saisw\.npmrc Completed in 1ms
11 timing config:load:user Completed in 1ms
12 timing config:load:file:C:\Users\saisw\AppData\Roaming\npm\etc\npmrc Completed in 1ms
13 timing config:load:global Completed in 1ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 2ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 14ms
19 verbose npm-session 390efe50c1f28e51
20 timing npm:load Completed in 27ms
21 timing arborist:ctor Completed in 1ms
22 timing idealTree:init Completed in 548ms
23 timing idealTree:userRequests Completed in 0ms
24 silly idealTree buildDeps
25 timing idealTree:#root Completed in 0ms
26 timing idealTree:buildDeps Completed in 2ms
27 timing idealTree:fixDepFlags Completed in 0ms
28 warn EBADENGINE Unsupported engine {
28 warn EBADENGINE   package: '[email protected]',
28 warn EBADENGINE   required: { node: '>=8 <=14' },
28 warn EBADENGINE   current: { node: 'v15.5.0', npm: '7.6.2' }
28 warn EBADENGINE }
29 timing idealTree Completed in 565ms
30 timing command:install Completed in 574ms
31 verbose stack Error: Unsupported platform
31 verbose stack     at checkPlatform (C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\node_modules\npm-install-checks\index.js:35:25)
31 verbose stack     at Arborist.[checkPlatform] (C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:235:5)
31 verbose stack     at C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:228:33
31 verbose stack     at async Arborist.buildIdealTree (C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:212:7)
31 verbose stack     at async Promise.all (index 1)
31 verbose stack     at async Arborist.reify (C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:131:5)
31 verbose stack     at async Install.install (C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\lib\install.js:120:5)
32 verbose pkgid [email protected]
33 verbose cwd C:\Users\saisw\notes-api
34 verbose Windows_NT 10.0.19042
35 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\saisw\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
36 verbose node v15.5.0
37 verbose npm  v7.6.2
38 error code EBADPLATFORM
39 error notsup Unsupported platform for [email protected]: wanted {"os":"darwin"} (current: {"os":"win32","arch":"x64"})
40 error notsup Valid OS:    darwin
40 error notsup Valid Arch:  undefined
40 error notsup Actual OS:   win32
40 error notsup Actual Arch: x64
41 verbose exit 1

from serverless-nodejs-starter.

jayair avatar jayair commented on July 29, 2024

Looks like it is Node 15 related for that specific package. We'll need to push an update for serverless-bundle for this.

from serverless-nodejs-starter.

jayair avatar jayair commented on July 29, 2024

Also, can you remove your package lock file and try installing it again? That package has a patch version that should fix this.

from serverless-nodejs-starter.

jayair avatar jayair commented on July 29, 2024

Just pushed a new version, https://github.com/AnomalyInnovations/serverless-bundle/releases/tag/v4.3.1.

I'm going to update this repo.

from serverless-nodejs-starter.

bedamatta05 avatar bedamatta05 commented on July 29, 2024

I have removed the package lock file and compiled npm install --save-dev --save-exact [email protected] and this throws the following error.

npm ERR! code EBADPLATFORM npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"darwin"} (current: {"os":"win32","arch":"x64"}) npm ERR! notsup Valid OS: darwin npm ERR! notsup Valid Arch: undefined npm ERR! notsup Actual OS: win32 npm ERR! notsup Actual Arch: x64

Complete log -

0 verbose cli [
0 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli   'C:\\Users\\saisw\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli   'install',
0 verbose cli   '--save-dev',
0 verbose cli   '--save-exact',
0 verbose cli   '[email protected]'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 3ms
5 timing config:load:builtin Completed in 4ms
6 timing config:load:cli Completed in 2ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:C:\Users\saisw\notes-api\.npmrc Completed in 1ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:C:\Users\saisw\.npmrc Completed in 1ms
11 timing config:load:user Completed in 1ms
12 timing config:load:file:C:\Users\saisw\AppData\Roaming\npm\etc\npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 1ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 13ms
19 verbose npm-session 7a96d3d291ee33a1
20 timing npm:load Completed in 24ms
21 timing arborist:ctor Completed in 0ms
22 timing arborist:ctor Completed in 0ms
23 timing arborist:ctor Completed in 0ms
24 timing arborist:ctor Completed in 0ms
25 timing idealTree:init Completed in 1086ms
26 timing idealTree:userRequests Completed in 1ms
27 silly idealTree buildDeps
28 silly fetch manifest [email protected]
29 http fetch GET 200 https://registry.npmjs.org/serverless-bundle 16ms (from cache)
30 silly placeDep ROOT [email protected] REPLACE for: [email protected] want: 4.3.1
31 silly fetch manifest concat-text-webpack-plugin@^0.1.10
32 http fetch GET 200 https://registry.npmjs.org/concat-text-webpack-plugin 3ms (from cache)
33 timing idealTree:#root Completed in 35ms
34 silly placeDep ROOT [email protected] OK for: [email protected] want: ^0.1.10
35 silly fetch manifest [email protected]
36 http fetch GET 304 https://registry.npmjs.org/concat 752ms (from cache)
37 timing idealTree:node_modules/serverless-bundle Completed in 756ms
38 silly placeDep ROOT [email protected] OK for: [email protected] want: 1.0.3
39 timing idealTree:node_modules/concat-text-webpack-plugin Completed in 1ms
40 timing idealTree:node_modules/concat Completed in 0ms
41 timing idealTree:buildDeps Completed in 795ms
42 timing idealTree:fixDepFlags Completed in 13ms
43 timing idealTree Completed in 1904ms
44 timing command:install Completed in 1914ms
45 verbose stack Error: Unsupported platform
45 verbose stack     at checkPlatform (C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\node_modules\npm-install-checks\index.js:35:25)
45 verbose stack     at Arborist.[checkPlatform] (C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:235:5)
45 verbose stack     at C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:228:33
45 verbose stack     at async Arborist.buildIdealTree (C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:212:7)
45 verbose stack     at async Promise.all (index 1)
45 verbose stack     at async Arborist.reify (C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:131:5)
45 verbose stack     at async Install.install (C:\Users\saisw\AppData\Roaming\npm\node_modules\npm\lib\install.js:120:5)
46 verbose pkgid [email protected]
47 verbose cwd C:\Users\saisw\notes-api
48 verbose Windows_NT 10.0.19042
49 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\saisw\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save-dev" "--save-exact" "[email protected]"
50 verbose node v15.5.0
51 verbose npm  v7.6.2
52 error code EBADPLATFORM
53 error notsup Unsupported platform for [email protected]: wanted {"os":"darwin"} (current: {"os":"win32","arch":"x64"})
54 error notsup Valid OS:    darwin
54 error notsup Valid Arch:  undefined
54 error notsup Actual OS:   win32
54 error notsup Actual Arch: x64
55 verbose exit 1

from serverless-nodejs-starter.

bedamatta05 avatar bedamatta05 commented on July 29, 2024

And please confirm which is the latest version repo, notes-api or notes-app-api or my-project ?

from serverless-nodejs-starter.

jayair avatar jayair commented on July 29, 2024

I don't think we've had Windows users with this error before. I wonder if it's related to npm 7 that you are using.

From looking around, setting fsevents as optional seems to fix this. https://stackoverflow.com/a/58178041/3369702

And please confirm which is the latest version repo, notes-api or notes-app-api or my-project ?

Not sure what you mean here. This repo is a starter that we use in our guides. So it depends on which guide you are following.

from serverless-nodejs-starter.

bedamatta05 avatar bedamatta05 commented on July 29, 2024

I installed node v14.17.0, and use the command npm install --save-dev --save-exact [email protected] and after this compiled npm install -f .. Now the path problem is solved. Thank you

But now I'm getting another problem at https://serverless-stack.com/chapters/add-a-create-note-api.html , while compiling serverless invoke local --function create --path mocks/create-event.json . Instead of
{ "statusCode": 200, "body": "{\"userId\":\"123\",\"noteId\":\"bf586970-1007-11eb-a17f-a5105a0818d3\",\"content\":\"hello world\",\"attachment\":\"hello.jpg\",\"createdAt\":1602891102599}" }

it's throwing an error :
Serverless: DOTENV: Could not find .env file. Serverless: Deprecation warning: CLI options definitions were upgraded with "type" property (which could be one of "string", "boolean", "multiple"). Below listed plugins do not predefine type for introduced options: - ServerlessPlugin for "out" - ServerlessOffline for "apiKey", "binPath", "cacheInvalidationRegex", "corsAllowHeaders", "corsAllowOrigin", "corsDisallowCredentials", "corsExposedHeaders", "disableCookieValidation", "enforceSecureCookies", "exec", "hideStackTraces", "host", "httpsProtocol", "location", "noAuth", "noEnvironment", "port", "prefix", "preserveTrailingSlash", "printOutput", "providedRuntime", "region", "resourceRoutes", "showDuration", "skipCacheInvalidation", "stage", "useSeparateProcesses", "websocketPort" Please report this issue in plugin issue tracker. Starting with next major release, this will be communicated with a thrown error. More Info: https://www.serverless.com/framework/docs/deprecations/#CLI_OPTIONS_SCHEMA Serverless: Deprecation warning: Starting with version 3.0.0, following property will be replaced: "provider.iamRoleStatements" -> "provider.iam.role.statements" More Info: https://www.serverless.com/framework/docs/deprecations/#PROVIDER_IAM_SETTINGS Serverless: Deprecation warning: Resolution of lambda version hashes was improved with better algorithm, which will be used in next major release. Switch to it now by setting "provider.lambdaHashingVersion" to "20201221" More Info: https://www.serverless.com/framework/docs/deprecations/#LAMBDA_HASHING_VERSION_V2 Serverless: Bundling with Webpack... { "statusCode": 500, "body": "{\"error\":\"Requested resource not found\"}" }

I have completed all the steps accordingly and now unable to fetch. Please help.

from serverless-nodejs-starter.

jayair avatar jayair commented on July 29, 2024

It's a 500 error, follow the steps in the chapter https://serverless-stack.com/chapters/add-a-create-note-api.html#common-issues

from serverless-nodejs-starter.

bedamatta05 avatar bedamatta05 commented on July 29, 2024

While completing the module (https://serverless-stack.com/chapters/add-a-create-note-api.html)
i've changed the region to ap-south-1 and while compiling serverless invoke local --function create --path mocks/create-event.json , it throws the following error.

code: 'ResourceNotFoundException',
  time: 2021-05-16T17:42:30.967Z,
  requestId: 'EEKOS440F287JA88MTUCH94143VV4KQNSO5AEMVJF66Q9ASUAAJG',
  statusCode: 400,
  retryable: false,
  retryDelay: 39.563195324762404
}
{
    "statusCode": 500,
    "body": "{\"error\":\"Requested resource not found\"}"
}

please check. but it works fine for the us-east-1.

from serverless-nodejs-starter.

jayair avatar jayair commented on July 29, 2024

Post these over on the forums for the relevant chapter discussion thread — https://discourse.serverless-stack.com

from serverless-nodejs-starter.

bedamatta05 avatar bedamatta05 commented on July 29, 2024

In the chapter https://serverless-stack.com/chapters/test-the-apis.html,
while deploying npx aws-api-gateway-cli-test --username [email protected] --password Passw0rd! --user-pool-id ap-south-1_HPhxRXhCE --app-client-id 7prrbnh2qb7qqckijv56k5qpq --cognito-region ap-south-1 --identity-pool-id ap-south-1:4035b314-5e28-4226-b176-84e0e781772e --invoke-url https://wx592asuj5.execute-api.ap-south-1.amazonaws.com/prod/notes --api-gateway-region ap-south-1 --path-template /notes --method POST --body "{\"content\":\"hello world\",\"attachment\":\"hello.jpg\"}"

its throwing an error

Authenticating with User Pool
Getting temporary credentials
Making API request
undefined:1
{\\
 ^

SyntaxError: Unexpected token \ in JSON at position 1
    at JSON.parse (<anonymous>)
    at makeRequest (C:\Users\saisw\AppData\Local\npm-cache\_npx\ea84c6478cf14779\node_modules\aws-api-gateway-cli-test\index.js:179:17)
    at C:\Users\saisw\AppData\Local\npm-cache\_npx\ea84c6478cf14779\node_modules\aws-api-gateway-cli-test\index.js:152:5
    at C:\Users\saisw\AppData\Local\npm-cache\_npx\ea84c6478cf14779\node_modules\aws-sdk\lib\credentials.js:124:23
    at C:\Users\saisw\AppData\Local\npm-cache\_npx\ea84c6478cf14779\node_modules\aws-sdk\lib\credentials.js:212:15
    at processTicksAndRejections (internal/process/task_queues.js:77:11)

please help in solving

Edit : As referred here sst/sst.dev#112 (comment) , i also tried to fix this by running in both powershell and cmd promt but it's not working for me. :((

from serverless-nodejs-starter.

jayair avatar jayair commented on July 29, 2024

Have you tried figuring out if the problem is with the format of the --body param?

I'm going to close this issue since this isn't related to the original gyp issue. Posting this in the forums for the relevant chapter would work better.

from serverless-nodejs-starter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.