nest_container : error TS2307: Cannot find module 'class-validator' or its corresponding type declarations - dockerfile

I'm trying to use the 'class-validator' module on a nest_container. It is not working.
My Dockerfile:
FROM node:latest
WORKDIR /usr/src/app
RUN npm install -g npm#9.3.1 && npm install -g
#nestjs/cli
RUN npm i --save validator class-validator class-transformer
COPY nest.sh .
EXPOSE 3000
CMD ["sh", "nest.sh"]
logs from my nest container:
error TS2307: Cannot find module 'class-validator' or its corresponding type declarations.
In my node_module/#type, they're is no class-validator folder, I don't know why.
I read already read similar posts but no one solved my problem.
I can't show you my json files because of the "do 4 spaces and CTRL + K to write code" thing isn't working.
What did I forget in my dockerfile ?
I'm trying to use 'class-validator' in a nest container
class-validator seems not wanting to be installed in the node_modules folder

Related

pathspec 'tools/n64 splat' did not match any file(s) known to git

so i tried castlevania game decomp and I follow this steps and I'm new to git
Inside the folder of your choice git clone https://github.com/Xeeynamo/sotn-decomp.git
Run sudo apt-get install -y $(cat tools/requirements-debian.txt) and everything worked
until this happen after i run this command: make update-dependencies
I got this error pathspec 'tools/n64 splat' did not match any file(s) known to git any idea on how to fix it, plz? I searched so much.
And this is the link to the decomp: https://github.com/Xeeynamo/sotn-decomp

How to add trix.css when it is removed after pruning?

After pruning with the command "docker system prune -a" nodejs wont build anymore beacuse trix.css is missing. I am assuming this was probably deleted while pruning. How can I resolve this error (see the error below)? Why is it not created again while building the container again since the file is in the docker file.
Required path doesn't exist: /code/bower_components/trix/dist/trix.css trix
[13:57:39] 'vendorcss' errored after 1.63 ms
[13:57:39] Error: Promise rejected without Error
at Domain.onError (/usr/local/lib/node_modules/gulp/node_modules/async-done/index.js:49:15)
at Object.onceWrapper (events.js:315:30)
at emitOne (events.js:116:13)
at Domain.emit (events.js:211:7)
at Domain._errorHandler (domain.js:134:21)
at process._fatalException (bootstrap_node.js:375:33)
[13:57:39] 'staging' errored after 41 ms
ERROR: Service 'nodejs' failed to build: The command '/bin/sh -c gulp staging' returned a non-
zero code: 1
Usually I use this command : "sudo docker-compose -f docker-compose-staging.yml build nodejs" when I want to build the container again. I am very new to this and would be greatfull for some help.
For me, this was the case:
The issue exists because trix.css was removed in the latest version. It has nothing to do with docker system prune as far as I understand.
You can compare the two versions here: https://github.com/basecamp/trix/compare/1.3.1...v2.0.0
Basically, in order to fix this issue, you need to do
yarn install
yarn build
inside bower_components. This is suggested in the official updated README of the trix repository: https://github.com/basecamp/trix.
Once done with that, you will have trix.css and trix.umd.min.js files for your perusal.

Cannot find module 'enquire.js' from 'slider.js'

I am using Antd with React, Jest and Enzyme. While testing simple shallow rendering I am getting error
"Cannot find module 'enquire.js' from 'slider.js'"
at Resolver.resolveModule (node_modules\jest-resolve\build\index.js:151:17
at Object. (node_modules\react-slick\lib\slider.js:37:38)
at Object. (node_modules\react-slick\lib\index.js:3:18)index file, test file and Error
I just want to copy the solution for this which where given here: https://github.com/ant-design/ant-design/issues/6317
For npm: rm -rf node_modules && npm install
For yarn: yarn upgrade
I found a very short way of above, just try this :
npm i enquire-js#0.1.0
0.1.0 depend on version come out

Docker cookbook not finding Docker file

I've got a Dockerfile I'm trying to build using the following code:
docker_image 'wafflehouse' do
source '/root/dockerimages/CentOS'
action :build_if_missing
read_timeout 6000
write_timeout 6000
end
Using test kitchen the builds fail:
Error executing action `build_if_missing` on resource 'docker_image[wafflehouse]'
No such image: sha256:4eda692c08e0a065cg91d74e82ffxxxxxxxx07b4341ad61fa61771cc4659af60
Docker::Error::NotFoundError
If I reference the Dockerfile directly in the code:
docker_image 'wafflehouse' do
source '/root/dockerimages/CentOS/Dockerfile'
action :build_if_missing
read_timeout 6000
write_timeout 6000
end
The build fails to find the files that are referenced in the Dockerfile to copy:
FROM centos
COPY wafflehouse.repo /etc/yum.repos.d
COPY wafflehouse-artifacts.repo /etc/yum.repos.d
COPY wafflehouse-snapshot-artifacts.repo /etc/yum.repos.d
RUN yum install -y net-tools
CMD ["bash"]
The files are in the same directory as the Dockerfile. Any ideas on either of these?
I believe you have a problem with the dockerfile instead of Chef.
You should keep in mind that you are providing a relative path to the source of the files you want to copy.
In order to fix this, try using absolute paths for source and target paths, something like:
FROM centos
COPY /root/dockerimages/CentOS/wafflehouse.repo /etc/yum.repos.d/wafflehouse.repo
COPY /root/dockerimages/CentOS/wafflehouse-artifacts.repo /etc/yum.repos.d/wafflehouse-artifacts.repo
COPY /root/dockerimages/CentOS/wafflehouse-snapshot-artifacts.repo /etc/yum.repos.d/wafflehouse-snapshot-artifacts.repo
RUN yum install -y net-tools
CMD ["bash"]

Yuglify compressor can't find binary from package installed through npm

I have a fresh virtualenv environment and have got the latest django-pipleline.
The JS compression with Closure works perfect, but CSS compression with Yuglify fails, due a node error:
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.closure.ClosureCompressor'
PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yuglify.YuglifyCompressor'
When I try to collect the static:
./manage.py collectstatic
It says:
pipeline.compressors.CompressorError: /usr/bin/env: node: No such file or directory
But I have clearly installed yuglify even as global:
sudo npm -g install yuglify
/usr/local/bin/yuglify -> /usr/local/lib/node_modules/yuglify/bin/yuglify
yuglify#0.1.2 /usr/local/lib/node_modules/yuglify
├── uglify-js#1.3.4
├── ycssmin#1.0.1
└── nopt#2.1.1
Trying to set the biney in settings doesn't help either:
PIPELINE_YUGLIFY_BINARY = '/usr/local/bin/yuglify'
I still get the same error. Why now such problems with npm? Is there something I have to setup additionally?
Alternatively is there a way to install yuglify with pip?
Many Thanks,
After 3 hours of suffering, I have found the solution.
This is happening because of a misnaming error, if you install from a package manager (npm) your bin may be called nodejs so you just need to symlink it like this:
ln -s /usr/bin/nodejs /usr/bin/node
Now it is working. This didn't happen with the older version, its is something new. But at least it is working again. I hope this helps someone else out there. :)
In my case both uglify-js and cssmin were somehow not installed.
So I have re-installed them again by using following command and then it starts working again.
sudo npm install -g cssmin uglify-js