When I generate a nodejs-server with swagger 3.0.1 in the online tool https://editor.swagger.io/ and try to npm start the project I always get the following error:
Error: Cannot find module './middleware/swagger.router'
Short-term fix: you can get it to run until the maintainer of oas3-tools and Smartbear (for this server generator) fixes their respective parts.
PROBLEM A: oas3-tools build script isn't copying the 'middleware' over to the 'dist' directory.
To fix this:
Start your generated server (this will run npm install and create the dist folder in node_modules/oas3-tools)
Go into ./node_modules/oas3-tools and manually copy the missing src/middleware to the dist folder.
Now that you have a middleware folder in your dist folder, run the following typescript compile command against it: tsc dist/middleware/
PROBLEM B:
The next issue is a typo on the path to the swagger document is incorrect.
To fix this:
In the index.js file of your generated server, change the string 'api/openapi.yaml' to 'api/swagger.yaml'
POSSIBLE EXTRA PROBLEM:
You may need to manually transpile your .ts files. Please see #Alex's comment below if you also run into this (i.e. error TS6053: File 'dist/middleware/.ts' not found. Found 1 error)
Swagger Editor bug posted here: https://github.com/swagger-api/swagger-editor/issues/2086
Oas3-tools bug posted here: https://github.com/bug-hunters/oas3-tools/issues/17
The latest version of oas3-tools is 2.1.2 is screwed up. Use 2.0.2 for now.
oas3-tools : "2.0.2"
Related
I have updated my custom library and UI Angular applications to version 15 but now when I try to run "ng serve" it says it can't find the module for my custom library. We are working with Artifactory for our repositorys. And I noticed that since I updated the Jenkins build to use Node 16 it packages the npm package differently.
So I'm curious if anyone has come across this before. I was able to consume the library without any issues when it was version 11, but after the update to 15 I get the following error.
Error: Module not found: Error: Can't resolve '#cto_compliance_amf/amf-library' in 'C:\Users\zkafpf7\Documents\MyProjects\amf_ui\src\app'
Any and all help is appreciated.
Turns out that when I updated to Node 16 for the Jenkins build, the babel script wasn't working correctly. I updated my pre-pack script to use shx instead of babel to move the files from the dist folder to the root folder. Then updated the .npmignore file to omit the files that weren't needed in the package. And now everything works. Hope this helps someone else.
I recently upgraded my project from vuetify 1.5 to 2.1.. I also updated the required dependencies and installed fibers, deepmerge, sass, sass-loader in devdependencies.
Now when I run "yarn serve" it throws following error.
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.plugins[12] misses the property 'apply'.
function
-> The run point of the plugin, required method.
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.plugins[12] misses the property 'apply'.
function
-> The run point of the plugin, required method.
at webpack (/home/usman/projects/project-crm/frontend/node_modules/webpack/lib/webpack.js:31:9)
at serve (/home/usman/projects/project-crm/frontend/node_modules/#vue/cli-service/lib/commands/serve.js:137:22)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
error Command failed with exit code 1.
I don't have a clue where is this error occuring. I searched on internet but didn't found solution on
this error...
configuration.plugins[12] misses the property 'apply'.
OK people!!!
I've found a solution(trick). Off course it is a trick the way I see it but it is working absolutely fine to me. Remember this error happened to me due to upgrade from vuetify 1.5 to 2.1....
Steps I took were,
Created a new project(name = candy) with latest Vue and Vuetify.
Installed all dependencies and devDependencies in this new project(candy in my case) which I had in my original projects package.json file.
You can open package.json file of your original project and terminal in new project(candy) and run commands yarn add "package name in original project or npm install "package name.
Then copied this(candy) package.json file and pasted it in my original project folder and renamed these files and folder to old.
File & folder == node_modules to node_modules_old, package.json to package_old.json, vue.config.js to vue.config_old.js, yarn.lock to yarn_old.lock.
Copy only package.json of candy project to the original project's folder.
Run command yarn install or npm install.
And the server runs now.
Further, you will have to set your code according to the project. It can be in vue.config.js mostly or in babel config file or webpack.config.js.
I have this error using ng new project_name:
An invalid configuration file was found ['angular.json']. Please delete the file before running the command.
I am getting this error I don't know how to get the solution.
I uninstalled #angular/cli and installed again
npm clean cache doesnt work too (I dont know if it is problem of my npm version
npm version is 6.4.1
node version is 8.11.1
what do i need to solve the problem?
If you are using the terminal of IntelliJ IDEA while there is a angular project already imported in the IDEA, it is the problem of the IDEA.So, open the command promt of your windows and create the project.
I did this and I was able to create the project.
The problem seems to be the _ in project_name resulting in the following error:
Schematic input does not validate against the Schema: {"name":"project_name","version":"6.0.1","newProjectRoot":"projects","skipInstall":false,"linkCli":false,"skipGit":false,"commit":null}
Errors:
Data path ".name" should match format "html-selector".
Replace _ e.g. with -.
Further readings:
Error when creating new project with Angular-CLI 6.1.2
Style Guide
Setting the working directory in IntelliJ's Karma task, to the Angular project's main directory, also fixes the problem.
I deleted the file in c:\users\XXX\.angular.json and it was running ok.
Run following if file is hidden. Open Terminal, run mv /Users/shivammishra/.angular.json /Users/shivammishra/angular.json.txt.
mv command will move the file to new location (angular.json.txt) and you can then delete.
Angular.js & Wrong Directions.
First of all, open a file called angular.js in the root folder.
And check if you add some wrong Directory. like the style or something like that. as example.
Suppose you add the bootstrap dependency and you want to add it to your project you will go to the angular.js and add it in the style configuration. so you will add it as the below:
"styles": [
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
Check if you add double dot .. not one dot in the path like the below:
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
Or you maybe add it in the following format:
"/node_modules/bootstrap/dist/css/bootstrap.min.css",
or
"node_modules/bootstrap/dist/css/bootstrap.min.css",
The correct format is :
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
I'm working on updating my project from using electron version 1.2.5
to the newest electron at this time which is 1.7.7 (atleast it was when I downloaded it). My node version 6.9.1.
I've encountered a problem when I start my project with this new electron version,
the error in general is about "could not locate the binding files. and it mostly regards the async module.
There is also some part of the exception regarding node-etcd module which I use in my project (version 5.0.3)
I found some information about this type of exception online but most of them says stuffs about rebuilding some node module using some npm commands which I didn't quiet understand. I tried to install async module again in a new folder and replace it (with its deps) in the node modules folder im currently using for my project, but I still got the same error.
I'm working in an offline enviorment where I can't take my project "out" to a computer with internet access, I can only bring things from the web to my project (like installing in some folder and then copying that into my project) so any npm or other commands that require web connection are not available to me directly on my work computer. (I can only use them in a different computer and copy the results to a flash drive and bring them to th
Here's 2 pictures of the error (sorry about the quality, its the best I could get):
First part of error
Second part of error
The solution that fixed the problem in my case was going into node_modules - > deasync - > index.js
Before line 31 I added a newline (next to the binding line)
and wrote:
modPath = __dirname;
This solution is hacky, it was accually ly found by an associate a while back, so I am not sure why it works, it might be an issue in deasync, but it fixed the problem.
Having issues getting swiper.js to work. Requires grunt/bower. I'm completely new to js generators and am only able to get through about half the walkthrough before running into issues.
When I type $grunt dist into terminal, I get the following response: -bash: dist: command not found
What step am I missing?
Followed the idangerous steps to the letter: http://www.idangero.us/sliders/swiper/plugins/scrollbar.php
I have most often see "X command not found" for one of the following reasons:
The project's Grunt dependencies aren't installed or aren't installed properly
Your Gruntfile is mis-configured or missing
To fix this, first make sure there is a package.json file in your project. This will tell the npm what dependencies the project has and install them accordingly (assuming the package.json file is also configured correctly).
Next, make sure you have installed grunt correctly.
If you're still having issues, open your Gruntfile and search for:
grunt.registerTask('dist
This will show where the "dist" task is being defined. If you for some reason don't find it, then there's your problem. If you do find it, then check the proceeding commands inside square brackets that look like this:
grunt.registerTask('dist', ['clean', 'dist-css', 'copy:fonts', 'dist-js', 'dist-docs']);
'clean', 'dist-css', etc. are all other tasks defined in the Gruntfile, and there could be an issue with those as well.
If there's an issue with your package.json or Gruntfile, then trying re-installing the project with bower and repeat the above steps to ensure that it's not an issue on your end.
If it's not, then something is probably wrong with the author's source code.